I have faced a problem with the CI server. Actually the problem was with MSBuild. Which is used to build assemblies at the server. The project has all referenced assemblies set to “Copy Local” True. Thus we are sure all required assemblies could be accessible by a weak reference at another environment. This works well locally when I build with Visual Studio. But when it is been doing with MSBuild at the server, one assembly is not copied to an output directory.
The investigation took me to the GAC where I found this assembly residing. So it looks like MSBuild finds this assembly there and does not copy. But why? The reason is Visual Studio “Copy Local” attribute is not well-synchronized with MSBuild “Private” element. For example, if you add an assembly from a file path and have not it at GAC. It will set “Copy Local” to true, but there will be no “Private” element at *.csproj. To fix it just toggle twice “Copy Local” attribute or edit *.csproj by hands