问题
I've raised a connect issue for that behavior.
VS 2015
copies to output GAC
references of a project reference regardless of copy local setting.
VS 2010
doesn't do that with the same solution & projects, respecting the copy local property.
The only workaround I've found so far is to add a direct reference to Microsoft.Web.Services3.dll
in Project A and set it to copy local = false.
Steps to reproduce:
Project A
|__ Project B (Project Reference, copy local = true)
|__Microsoft.Web.Services3.dll (GAC, copy local = false)
Actual:
Microsoft.Web.Services3.dll
is being copied to the output directory of Project A.
Expected:
Microsoft.Web.Services3.dll
is not being copied to the output directory of Project A.
Any idea why this happens? The MSDN documentation clearly states that GAC
dependencies should not be copied to output and VS 2010
respects that.
回答1:
When I moved from VS2013 to VS2015, I ran into a similar issue with several third party GAC'ed assemblies. The solution for me was to go into each .csproj file and add the following:
<PropertyGroup>
<DoNotCopyLocalIfInGac>true</DoNotCopyLocalIfInGac>
</PropertyGroup>
来源:https://stackoverflow.com/questions/32647713/vs-2015-copies-to-output-gac-references-of-a-project-reference-regardless-of-cop