VS 2015 copies to output GAC references of a project reference regardless of copy local setting

我的梦境 提交于 2019-12-06 19:21:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!