title: NHibernate.MappingException: No persister for
body: <p>I'm begining my adventure with nHibernate and I have a problem.</p>
  
  <p>My code:
  Model/Project.cs</p>
  
  <pre><code>namespace entity1.Model
  {
      public class Project
      {
          public Guid Id { get; set; }
          public string Name { get; set; }
          public string Description { get; set; }
      }
  }
  </code></pre>
  
  <p>Model/Project.hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" auto-import="true" namespace="entity1.Model" assembly="entity1.Model"&gt;
    &lt;class name="entity1.Model.Project, entity1.Model" lazy="false"&gt;
      &lt;id name="id" column="prj_id"&gt;&lt;/id&gt;
      &lt;property name="Name" column="prj_name" /&gt;
      &lt;property name="Description" column="prj_description" /&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Web.config</p>
  
  <pre><code>&lt;hibernate-configuration  xmlns="urn:nhibernate-configuration-2.2" &gt;
      &lt;session-factory&gt;
        &lt;property name="connection.driver_class"&gt;NHibernate.Driver.SqlClientDriver&lt;/property&gt;
        &lt;property name="connection.connection_string"&gt;Server=(local);initial catalog=todo;Integrated Security=True&lt;/property&gt;
        &lt;property name="dialect"&gt;NHibernate.Dialect.MsSql2008Dialect&lt;/property&gt;
        &lt;property name="proxyfactory.factory_class"&gt;NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle&lt;/property&gt;
        &lt;mapping assembly="entity1.Model"/&gt;
      &lt;/session-factory&gt;
    &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Test.aspx.cs</p>
  
  <pre><code>Project project = new Project();
  // [...]
  Configuration c = new Configuration();
  c.AddAssembly(Assembly.GetCallingAssembly());
  
  ISessionFactory factory = c.BuildSessionFactory();
  using (ISession session = factory.OpenSession()) {
      using(ITransaction transaction = session.BeginTransaction()){
          session.Save(project);
          transaction.Commit();
  }
  </code></pre>
  
  <p>And exception:
  No persister for: entity1.Model.Project </p>
  
  <p>What is wrong?</p>
  
  <p>I'm realy thank for everyone help.
  Sorry for my english. It's not too good.</p>