-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Could not load file or assembly 'NHibernate.ByteCode.Castle'
PostPosted: Tue Oct 19, 2010 12:33 pm 
Newbie

Joined: Tue Oct 19, 2010 12:22 pm
Posts: 2
I am getting the following error after upgrading from NHibernate 1.2.0.GA to NHibernate-2.1.2.GA:

2010-10-19 11:43:13,028 [10] ERROR NHibernate.Util.ReflectHelper - Could not load type NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle.
System.IO.FileNotFoundException: Could not load file or assembly 'NHibernate.ByteCode.Castle' or one of its dependencies. The system cannot find the file specified.
File name: 'NHibernate.ByteCode.Castle'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError)


In my Project, I have added lgo4net, NHibernate, and NHibernate.ByteCode.Castle as a reference. Copy Local is set to True for all of those. I even added "using NHibernate.ByteCode.Castle" to the class file that is calling NHibernate functions as well. Any ideas? Where is it looking for this DLL?


Top
 Profile  
 
 Post subject: Re: Could not load file or assembly 'NHibernate.ByteCode.Castle'
PostPosted: Tue Oct 19, 2010 2:19 pm 
Newbie

Joined: Tue Oct 19, 2010 12:22 pm
Posts: 2
To clarify, I have a client that calls a Framework project (which actually makes the NHibernate calls). The Framework project is what I refer to when I say I have added log4net, NHibernate, and NHibernate.Bytecode.Castle as a reference.

To throw another wrench in this, if I add NHibernate.Bytecode.Castle to my client, it works. But it shouldn't have to work that way...we don't want any client using the Framework to have to add this reference.


Top
 Profile  
 
 Post subject: Re: Could not load file or assembly 'NHibernate.ByteCode.Castle'
PostPosted: Mon Dec 13, 2010 12:59 pm 
Newbie

Joined: Fri Nov 04, 2005 4:13 pm
Posts: 6
If you are having an issues with the assembly not copying local, I had this same issue and used the following solution.

Add a class to the framework project that makes code references into the assemblies missing. I could not find the reason Visual Studio would not copy the dll's local even with "Copy Local" set true, but making code references into the missing assemblies did trigger the copy local.

internal class ReferenceBug
{
static void Fix()
{
Castle.DynamicProxy.DefaultProxyBuilder fix1 = new Castle.DynamicProxy.DefaultProxyBuilder();
NHibernate.ByteCode.Castle.ProxyFactoryFactory fix2 = new NHibernate.ByteCode.Castle.ProxyFactoryFactory();
}
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.