VS 2015复制到项目参考的输出GAC参考,而不考虑复制本地设置 [英] VS 2015 copies to output GAC references of a project reference regardless of copy local setting

查看:70
本文介绍了VS 2015复制到项目参考的输出GAC参考,而不考虑复制本地设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我针对该行为提出了连接问题.

VS 2015 会复制到项目引用的输出 GAC 引用,而不考虑副本本地设置. VS 2010 在相同的解决方案中无法做到这一点&项目,尊重复制本地财产.到目前为止,我发现的唯一解决方法是在项目A中添加对 Microsoft.Web.Services3.dll 的直接引用,并将其设置为copy local = false.

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.

复制步骤:

Project A
|__ Project B (Project Reference, copy local = true)
     |__Microsoft.Web.Services3.dll (GAC, copy local = false)

实际:

Microsoft.Web.Services3.dll 被复制到项目A的输出目录.

Microsoft.Web.Services3.dll is being copied to the output directory of Project A.

预期:

Microsoft.Web.Services3.dll 未复制到项目A的输出目录.

Microsoft.Web.Services3.dll is not being copied to the output directory of Project A.

知道为什么会这样吗? MSDN文档明确指出,<不应将code> GAC 依赖项复制到输出,并且 VS 2010 会遵守此要求.

Any idea why this happens? The MSDN documentation clearly states that GAC dependencies should not be copied to output and VS 2010 respects that.

推荐答案

当我从VS2013迁移到VS2015时,我遇到了多个第三方GAC程序集的类似问题.对我来说,解决方案是进入每个.csproj文件并添加以下内容:

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>

这篇关于VS 2015复制到项目参考的输出GAC参考,而不考虑复制本地设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆