title: NHibernate [MappingException: Could not compile the mapping document: iMed.Models.Device.hbm.xml]
body: <p>I'm currently trying to use nhibernate with MVC 3.5. </p>
  
  <p>I have placed my nhibernate.cfg.xml in my root to my MVC project.
  Please see screen grab of project. Both xml files are set to Embedded Resource.</p>
  
  <p>I have a DeviceRepository.cs That has a method that uses Device.cs for the persistence. </p>
  
  <p>Here is the xml of nhibernate.cfg.xml</p>
  
  <p>
  </p>
  
  <p>
    </p>
  
  <pre><code>&lt;!-- properties --&gt;
  &lt;property name="connection.provider"&gt;NHibernate.Connection.DriverConnectionProvider&lt;/property&gt;
  &lt;property name="connection.driver_class"&gt;NHibernate.Driver.MySqlDataDriver&lt;/property&gt;
  &lt;property name="connection.connection_string"&gt;Server=192.168.1.5;Database=imed_development;User ID=root;Password=lights337&lt;/property&gt;
  &lt;property name="dialect"&gt;NHibernate.Dialect.MySQL5Dialect&lt;/property&gt;
  
  &lt;!-- mapping files --&gt;
  &lt;mapping resource="iMed.Models.Device.hbm.xml" assembly="iMed" /&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <p>Here is the xml of Device.hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"&gt;
    &lt;class name="iMed.Models.Device" table="devices"&gt;
      &lt;id name="Id" column="ID" type="int"&gt;
        &lt;generator class="native"&gt;&lt;/generator&gt;
      &lt;/id&gt;
      &lt;property name="Identifier" column="identifier" type="String"&gt;&lt;/property&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>I'm currently getting a </p>
  
  <pre><code>{"Could not compile the mapping document: iMed.Models.Device.hbm.xml"}
  {"persistent class iMed.Models.Device not found"}
  </code></pre>
  
  <p>I'm pretty new to this, any input would be greatly appreciated... </p>
  
  <p>Thanks in advance... </p>
  
  <p>Patrick</p>