title: Fluent nHibernate error - Could not compile the mapping document: (XmlDocument)
body: <p>I have read all questions about Fluent nHibernate and didnt find answer for that.
  I am trying to run the Getting Started tutorial <a href="http://wiki.fluentnhibernate.org/Getting_started#Your_first_project" rel="nofollow">here</a>  and I get this error:</p>
  
  <p><strong>Could not compile the mapping document: (XmlDocument)</strong></p>
  
  <p>The error happens when I am running the CreateSessionFactory:</p>
  
  <pre><code>    private static ISessionFactory CreateSessionFactory()
      {
          return Fluently.Configure()
              .Database(SQLiteConfiguration.Standard
                  .UsingFile(DBfile))
              .Mappings(m =&gt;
                  m.FluentMappings.AddFromAssemblyOf&lt;Program&gt;())
              .ExposeConfiguration(BuildSchema)
              .BuildSessionFactory();
      }
  </code></pre>
  
  <p>Does anyone ever got this? Complete exception:</p>
  
  <pre><code>        NHibernate.MappingException was unhandled by user code
            Message=Could not compile the mapping document: (XmlDocument)
            Source=NHibernate
            StackTrace:
                 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 mappingDocument, String documentFileName) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 530
                 at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 499
                 at NHibernate.Cfg.Configuration.ProcessMappingsQueue() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1832
                 at NHibernate.Cfg.Configuration.AddDocumentThroughQueue(NamedXmlDocument document) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1823
                 at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader, String name) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1816
                 at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 632
                 at NHibernate.Cfg.Configuration.AddDocument(XmlDocument doc, String name) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 483
                 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()
            InnerException: NHibernate.MappingException
                 Message=persistent class FNHTest.Entities.Employee, FluentNHibernate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null not found
                 Source=NHibernate
                 StackTrace:
                      at NHibernate.Cfg.XmlHbmBinding.Binder.ClassForFullNameChecked(String fullName, String errorMessage) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmBinding\Binder.cs:line 103
                      at NHibernate.Cfg.XmlHbmBinding.Binder.ClassForNameChecked(String name, Mappings mappings, String errorMessage) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmBinding\Binder.cs:line 117
                      at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindClass(IEntityMapping classMapping, PersistentClass model, IDictionary`2 inheritedMetas) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmBinding\ClassBinder.cs:line 35
                      at NHibernate.Cfg.XmlHbmBinding.RootClassBinder.Bind(HbmClass classSchema, IDictionary`2 inheritedMetas) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmBinding\RootClassBinder.cs:line 19
                      at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.AddRootClasses(HbmClass rootClass, IDictionary`2 inheritedMetas) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmBinding\MappingRootBinder.cs:line 83
                      at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.AddEntitiesMappings(HbmMapping mappingSchema, IDictionary`2 inheritedMetas) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmBinding\MappingRootBinder.cs:line 42
                      at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.Bind(HbmMapping mappingSchema) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmBinding\MappingRootBinder.cs:line 29
                      at NHibernate.Cfg.Configuration.AddDeserializedMapping(HbmMapping mappingDocument, String documentFileName) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 522
                 InnerException: System.IO.FileLoadException
                      Message=Could not load file or assembly 'FluentNHibernate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
                      Source=mscorlib
                      FileName=FluentNHibernate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
                      FusionLog==== Pre-bind state information ===
          LOG: User = dev-dsk02\ademar.gomes
          LOG: DisplayName = FluentNHibernate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
           (Fully-specified)
          LOG: Appbase = file:///C:/code/GeneralTests/FluentNHibernate/FluentNHibernate/bin/Debug/
          LOG: Initial PrivatePath = NULL
          Calling assembly : NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.
          ===
          LOG: This bind starts in default load context.
          LOG: Using application configuration file: C:\code\GeneralTests\FluentNHibernate\FluentNHibernate\bin\Debug\FluentNHibernate.vshost.exe.Config
          LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
          LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
          LOG: Attempting download of new URL file:///C:/code/GeneralTests/FluentNHibernate/FluentNHibernate/bin/Debug/FluentNHibernate.DLL.
          WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
          ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
  
                      StackTrace:
                           at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark, Boolean loadTypeFromPartialName)
                           at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark)
                           at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark)
                           at System.Type.GetType(String typeName)
                           at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Util\ReflectHelper.cs:line 291
                           at NHibernate.Util.ReflectHelper.ClassForName(String name) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Util\ReflectHelper.cs:line 181
                           at NHibernate.Cfg.XmlHbmBinding.Binder.ClassForFullNameChecked(String fullName, String errorMessage) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\XmlHbmBinding\Binder.cs:line 99
                      InnerException: 
  </code></pre>