Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 742
vezenkov Avatar asked Sep 18 '15 08:09

vezenkov


1 Answers

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>
like image 182
ninja coder Avatar answered Oct 16 '22 17:10

ninja coder