title: Build Via NAnt vs Visual Studio - One dll Missing
body: <p>My solution includes these two projects:</p>
  
  <ul>
  <li>MyNamespace.Web.UI</li>
  <li>MyNamespace.Web.Core</li>
  </ul>
  
  <p>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.  </p>
  
  <p>But when I build from NAnt, it is not there, which results in a runtime exception.  Here's what the NAnt task looks like:</p>
  
  <pre><code>&lt;target name="compile" depends="init"&gt;
      &lt;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="." /&gt;
      &lt;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="." /&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>There are several other dlls referenced in Core and not in UI, and they appear in Bin as expected after the NAnt build.</p>
  
  <p>My workaround is to reference Foobar.dll in the UI project, but that makes me a little nauseous.  Any idea what can cause this?</p>
  
  <p>(Incidentally Foobar.dll is actually NHibernate.ProxyGenerators.CastleDynamicProxy.dll)</p>