My build machine was leaving out a referenced DLL after the standard full refresh from source control. Eventually I find that the “Copy Local” property for said DLL was false, while on my machine it was true. Odd. Google gives me what seems to be the answer: cycle the “Copy Local” property from true to false and back again. Sure enough that modifies the project file so that reference is marked as “Private”:
<Private>True</Private>
This carries through source control and ends up on the build machine, and now “Copy Local” is true there as well as my laptop. Yay! Not.. Still the DLL is not copied to the bin.
Back to the drawing board. For whatever reason that DLL was in the build machine’s GAC. A referenced assembly isn’t copied to the the bin if the DLL is in the GAC, even though the path to the DLL is specified and “Copy Local” is true. From MSDN:
“If you deploy an application that contains a reference to a custom component that is registered in the GAC, the component will not be deployed with the application, regardless of the CopyLocal setting.”
It’s unfortunate that the build environment can affect what references are deployed, especially when the references are explicit.
To work around this, I used gacutil from an administrator VS prompt to remove the reference from the build machine’s GAC and the build finally included the needed references.