That's the structure of our solution:
Solution.sln
WebApp.csproj
references ClassLibrary
ClassLibrary.csproj
references System.Net.Http.Formatting.dll with Copy local = false
When I build the Solution with source code of both WebApp and ClassLibrary, copy local works as expected and System.Net.Http.Formatting.dll is not copied to the WebApp/bin directory.
However, when we distribute our project to the end clients, we give them only the WebApp source code which reference compiled class libraries (.dll). In that case the Solution looks like this:
Solution.sln
WebApp.csproj
references ClassLibrary.dll which uses System.Net.Http.Formatting.dll
When this partially compiled Solution is compiled, the System.Net.Http.Formatting.dll is copied to the WebApp/bin folder which is causing us some troubles.
I've examined the detailed build output and dll is copied by the Copy task and the source location for this dll is
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.Formatting.dll
There are some other mentions of the System.Net.Http.Formatting.dll assembly which I don't quite understand.
How to ensure that System.Net.Http.Formatting.dll isn't copied to the bin folder?
Thanks!