My solution includes these two projects:
- MyNamespace.Web.UI
- MyNamespace.Web.Core
UI references Core, and Core references Foobar.dll, which exists nowhere except my library. When I build from Visual Studio 2008 Foobar.dll is in the UI project's Bin folder as expected. I have made certain it was not there before the build.
But when I build from NAnt, it is not there, which results in a runtime exception. Here's what the NAnt task looks like:
<target name="compile" depends="init">
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline="${solution.file} /m /t:Clean /p:Configuration=${project.config} /v:q" workingdir="." />
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline="${solution.file} /m /t:Rebuild /p:Configuration=${project.config} /v:q" workingdir="." />
</target>
In VS I have tried building, rebuilding, rebuilding all in release mode and debug mode, etc. It's always the same. Foobar.dll is in the Bin folder. Not so with NAnt. I have tried also to remove the /m switch from the NAnt script. Same result.
There are several other dlls referenced in Core and not in UI, and they appear in Bin as expected after the NAnt build.
My workaround is to reference Foobar.dll in the UI project, but that makes me a little nauseous. Any idea what can cause this?
(Incidentally Foobar.dll is actually NHibernate.ProxyGenerators.CastleDynamicProxy.dll)