我不能解決的問題:嘗試從http://wiki.fluentnhibernate.org/Getting_started#Your_first_project 誤差執行教程發生在CreateSessionFactory()方法:FluentNHibernate CreateSessionFactory錯誤
FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete conf
iguration was used while creating a SessionFactory. Check PotentialReasons colle
ction, and InnerException for more detail.
---> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplet
e configuration was used while creating a SessionFactory. Check PotentialReasons
collection, and InnerException for more detail.
---> NHibernate.MappingException: Could not compile the mapping document: (XmlD
ocument) ---> NHibernate.MappingException: persistent class fluentNHibernateexam
ple.Entities.Employee, fluentNHibernate, Version=1.0.0.0, Culture=neutral, Publi
cKeyToken=null not found ---> System.IO.FileLoadException: Could not load file o
r assembly 'fluentNHibernate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=n
ull' or one of its dependencies. The located assembly's manifest definition does
not match the assembly reference. (Exception from HRESULT: 0x80131040)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Bool
ean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean l
oadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean
ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName)
at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName n
ame, Boolean throwOnError) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Util\Ref
lectHelper.cs:line 291
at NHibernate.Cfg.XmlHbmBinding.Binder.ClassForFullNameChecked(String fullNam
e, String errorMessage) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmB
inding\Binder.cs:line 99
--- End of inner exception stack trace ---
at NHibernate.Cfg.XmlHbmBinding.Binder.ClassForFullNameChecked(String fullNam
e, String errorMessage) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmB
inding\Binder.cs:line 103
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindClass(IEntityMapping classMap
ping, PersistentClass model, IDictionary`2 inheritedMetas) in d:\CSharp\NH\NH\nh
ibernate\src\NHibernate\Cfg\XmlHbmBinding\ClassBinder.cs:line 35
at NHibernate.Cfg.XmlHbmBinding.RootClassBinder.Bind(HbmClass classSchema, ID
ictionary`2 inheritedMetas) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Xml
HbmBinding\RootClassBinder.cs:line 19
at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.AddEntitiesMappings(HbmMapp
ing mappingSchema, IDictionary`2 inheritedMetas) in d:\CSharp\NH\NH\nhibernate\s
rc\NHibernate\Cfg\XmlHbmBinding\MappingRootBinder.cs:line 42
at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.Bind(HbmMapping mappingSche
ma) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmBinding\MappingRootBi
nder.cs:line 29
at NHibernate.Cfg.Configuration.AddDeserializedMapping(HbmMapping mappingDocu
ment, String documentFileName) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\
Configuration.cs:line 522
--- End of inner exception stack trace ---
at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception) in d:\CSharp
\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 342
at NHibernate.Cfg.Configuration.AddDeserializedMapping(HbmMapping mappingDocu
ment, String documentFileName) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\
Configuration.cs:line 530
at NHibernate.Cfg.Configuration.ProcessMappingsQueue() in d:\CSharp\NH\NH\nhi
bernate\src\NHibernate\Cfg\Configuration.cs:line 1832
at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String
name) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 630
at NHibernate.Cfg.Configuration.AddDocument(XmlDocument doc, String name) in
d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 481
at NHibernate.Cfg.Configuration.AddDocument(XmlDocument doc) in d:\CSharp\NH\
NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 455
at FluentNHibernate.PersistenceModel.Configure(Configuration cfg)
at FluentNHibernate.Cfg.MappingConfiguration.Apply(Configuration cfg)
at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration()
--- End of inner exception stack trace ---
at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration()
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
--- End of inner exception stack trace ---
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
at Examples.FirstProject.Program.CreateSessionFactory() in C:\_Learning\ORM\f
luentNHibernate\Program.cs:line 120
我使用Windows 7時,Visual Studio 29010,FluentNHibernate 1.2)
它看起來像你的應用程序期待fluentNHibernate DLL的版本1.0.0.0,或者它丟失或者你正在使用更新版本的dll – Waqas
今天我已經從http://fluentnhibernate.org/downloads/releases/fluentnhibernate下載fluentnHibernate -NH3.1-1.2.zip –