title: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle'
body: <p>Well,</p>
  
  <p>As I read and try every topic similar without success, I decided to post my own question.
  My solution has a console app and a class library for dataaccess. The Nhibernate configuration is inside the appconfig in the console app (which I'm currently using for debug, as I will after make a Web App and migrate all configuration to web.config).</p>
  
  <p>The exception is well know:</p>
  
  <p><code>NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle.dll' during configuration of proxy factory class. Possible causes are: - The NHibernate.Bytecode provider assembly was not deployed. - The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed. Solution: Confirm that your deployment folder contains one of the following assemblies: NHibernate.ByteCode.LinFu.dll NHibernate.ByteCode.Castle.dll ---&gt; System.IO.FileNotFoundException: Could not load file or assembly 'NHibernate.ByteCode.Castle.dll' or one of its dependencies. The system cannot find the file specified.</code></p>
  
  <p>The steps I took to try to solve it:</p>
  
  <p>1) The dll in the deployment folder - I have the following dll in my bin:<br>
  Antlr3.Runtime.dll - v. 3.1.3.42154<br>
  <strong>Castle.Core.dll - v. 2.5.1.2121</strong><br>
  Castle.DynamicProxy2.dll - v. 2.2.0.6628<br>
  Iesi.Collections.dll - v.3.0.0.1002<br>
  log4net.dll - v. 1.2.10.0<br>
  NHibernate.ByteCode.Castle.dll - <strong>v.3.0.0.2001</strong>
  NHibernate.dll - v.3.0.0.1002<br>
  Oracle.DataAccess.dll - v.4.112.1.2<br>
  Remotion.Data.Linq.dll - v.1.13.41.2  </p>
  
  <p>2) The configuration in configuration block  </p>
  
  <pre><code> &lt;hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"&gt;
  &lt;session-factory&gt;
    &lt;property name="connection.provider"&gt;NHibernate.Connection.DriverConnectionProvider&lt;/property&gt;
    &lt;property name="dialect"&gt;NHibernate.Dialect.Oracle10gDialect&lt;/property&gt;
    &lt;property name="connection.driver_class"&gt;NHibernate.Driver.OracleDataClientDriver&lt;/property&gt;
    &lt;property name="connection.connection_string_name"&gt;MetaManager&lt;/property&gt;
    &lt;property name="proxyfactory.factory_class"&gt;NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle&lt;/property&gt;
    &lt;mapping assembly="MetaManager.Data"/&gt;
  &lt;/session-factory&gt;
  </code></pre>
  
  <p></p>
  
  <p>3) I set my MetaManager.Data project to deploy in a x86 CPU<br>
  4) All dll in my bin folder are referenced in the project.  </p>
  
  <p>I think this it it. I do not know were else to go :(</p>
  
  <p>Pedro Dusso</p>
  
  <p>updates in <strong>bold</strong></p>