Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm working on a project with a similar architecture, and ran into similar problems just yesterday - needed to include references for NHibernate in my project, even though there no direct references in the code to those assemblies. </p> <p>Otherwise, got a runtime error, complaining about not being able to find NHibernate.ByteCode.Castle.</p> <p>The problem turned out to be the way I was building. The NHibernate assemblies were not being properly propogated to my application's runtime directory, because I was using the standard VS2008 folder structure (bin\Debug, etc).</p> <p>The first part of the fix was to create a single directory where all the assemblies are built and run. You can do this by setting the Output path (on the project's Build tab) for all the projects in your solution to point to this directory.</p> <p>The second part of the fix was to set Copy Local = True for all the NHIbernate refs, and also the other assemblies in your solution (you don't need to set this for the standard assemblies - System, etc). This causes VS to copy all the assemblies used by a project to the common runtime directory everytime you build.</p> <p>You should then be able to eliminate the NHibernate references from all the projects that don't use them directly.</p> <p>This worked for me, but I can't help wondering if there's a better way to solve this problem. But it will do for now.</p> <p><strong>Edit:</strong></p> <p>After some more testing, it appears that there is a problem with all the Castle DLLs, NHibernate.ByteCode.Castle most notably. </p> <p>One of the project's in my application is an assembly that contains the NHibernate logic, which contains references to all the NHibernate DLLs, including NHibernate.ByteCode.Castle.</p> <p>When I add a reference to that assembly in another project, and build it, all the NHibernate DLLs get copied to the other project's Output directory - <strong>except the Castle DLLs!</strong>. </p> <p><a href="https://stackoverflow.com/questions/1560050/could-not-load-file-or-assembly-nhibernate">Other people have had similar problems</a> I tried some of the workarounds suggested, with no luck.</p> <p>I strongly suspect that the Castle DLLs don't properly support Microsoft's conventions for propagating dependant assemblies to other projects, but don't know enough to be sure.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload