title: NHibernate mapping exception. No persister for: NHibernateTesting.Account
body: <p>I'm just trying to start learning NHibernate, and while testing with an extremely simple POCO I'm already having issues. I'm getting the No Persister exception, here is what my code looks like:</p>
  
  <p><code>Account</code> table:</p>
  
  <pre><code>create table Account
  (
      AccountID int primary key identity(1,1),
      AccountName varchar(10),
      CreateDate datetime
  )
  go
  </code></pre>
  
  <p><code>Account</code> class:</p>
  
  <pre><code>public class Account
  {
      public virtual int AccountID { get; set; }
      public virtual string AccountName { get; set; }
      public virtual DateTime CreateDate { get; set; }
  
      public Account()
      {
          AccountID = 0;
          AccountName = "";
          CreateDate = new DateTime();
      }
  }
  </code></pre>
  
  <p>Mapping file, <code>Account.hbm.xml</code> (yes, it's embedded into assembly):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                     namespace="NHibernateTesting" assembly="NHibernateTesting"&gt;
    &lt;class name="Account" table="Account"&gt;
      &lt;id name="AccountID"&gt;
        &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;property name="AccountName" /&gt;
      &lt;property name="CreateDate" /&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Config section in config file:</p>
  
  <pre><code>&lt;hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"&gt;
      &lt;session-factory&gt;
        &lt;property name="dialect"&gt;NHibernate.Dialect.MsSql2008Dialect&lt;/property&gt;
        &lt;property name="connection.provider"&gt;NHibernate.Connection.DriverConnectionProvider&lt;/property&gt;
        &lt;property name="connection.connection_string"&gt;My connection string&lt;/property&gt;
  
        &lt;mapping assembly="NHibernateTesting" /&gt;
  
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Finally, the code making the call:</p>
  
  <pre><code>using (var session = NHibernateHelper.GetASession())
  {
      using (var tran = session.BeginTransaction())
      {
          var newAccount = new Account();
          newAccount.AccountName = "some name";
  
          session.Update(newAccount); // Exception thrown here.
  
          tran.Commit();
      }
  }
  </code></pre>
  
  <p>Can anyone see what I'm doing wrong or why I would be getting this exception, I've read on the web the issue is related to mapping, but I just can't see what wrong in this example.</p>