We have several external DLL files being referenced in our Web Application Project. We have a deployment project for installing on the hosting servers. When we were using .NET 3.5 and Visual Studio 2008 the DLL files were being copied to the bin folder. Since we have upgraded to .NET 4 and Visual Studio 2010 this no longer happens, and we are getting server errors since the references cannot be found.
CopyLocal is set to true, and I cannot find anything inside the web.config which suggests this is being set elsewhere.
Best Answer
There is a bug in Visual Studio 2010. By default the XML in the solution file looks like this:
Whereas MSBuild is expecting this below, so that the DLL file will be included in the deployment:
The trick is to set
Copy Local
toFalse
, save the project and then reset it toTrue
- save again. This includes the Private node correctly, which MSBuild respects.It appears that the default for no included private node (
Copy Local
) in Visual Studio 2010 isTrue
, while MSBuild reads that missing node asFalse
.