Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory

Oct 6, 2010 at 4:22 PM
When POSTing initial set-up page, the page responds with exception:
Setup failed:
Exception has been thrown by the target of an invocation.
Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' 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
Could not load file or assembly 'NHibernate.ByteCode.Castle' or one of its dependencies. The system cannot find the file specified.
I receive this error selecting built-in storage and an existing SQL Server db.  I receive this error downloading the source in hte .zip distribution and cloning the Hg repository (per wiki instructions).  I get the error on XP (x86) an Vista (x64).  I have tried building the application for x86 instead of any CPU.  I have added the ..ByteCode.. assembly as a reference to Orchard.Framework, .Core and .Setup, and I have added the ByteCode assembly to the GAC.
The exception occurs when the repository is accessed when setting up the Shell Descriptor.  I believe this is the first time the repository is accessed.
I am using VS 2010, and I have used Cassini, IIS 6 and IIS 7.  I am using version 0.5.146 of Orchard.  The error is consistent, but I have talked to others (with older source base), and they do not get the error.  The problem was reported in January here, but no solution identified.
Any ideas?
Oct 6, 2010 at 5:04 PM

Are you running in full trust?

Oct 6, 2010 at 6:22 PM

Yes on the XP machine, I believe so on the Vista machine (I do not currently have access to it).

Oct 7, 2010 at 11:33 AM

SOLVED: This problem has been resolved. 

Background:  My first attempt with the source code was downloading with the .zip, but when opening in VS 2010, there were many broken reference links.  In an effort to find a way to resolve the references without modifying the code base, many of the library assemplies were loaded into the GAC.  Later, after getting the source by cloning the (Hg) repository, I had the problem described in this discussion.

Solution: Removed all (all that could be removed) associated assemblies from the GAC; I didn't really want them there anyway.  Application runs o.k., at least with built-in storage.

Oct 7, 2010 at 3:58 PM

Ah, yes, that explains it. We do have some work to do to improve that situation as it's entirely understandable that you'd attempt to do that.