I am running Visual Studio 2015.
I have a utility library project that references a number of third party assemblies, which are all registered in the GAC. In that project, all of the dependencies that are registered in the GAC are references with copy local set to false. When I build that project, the GAC assemblies are not copied to the build directory.
The utility project is then referenced, as a project, by another project, with "copy local" set to true. Then the referencing project builds, all of the GAC assemblies referenced by the utility project are copied to the build directory. These assemblies are quite large and it really slows down the build and bloats the build directory.
Visual Studio 2013 did not do this. Secondary references that were registered in the GAC were not copied. I should also note that in Visual Studio 2015, the secondary references are also copied if I reference the utility project as a file rather than as a project. Is there a way to stop it from copying the secondary dependencies?
Here is a section of the Detailed output from MSBuild for one of the secondary references that is getting copied:
4> Dependency "ESRI.ArcGIS.Catalog, Version=10.5.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86".
4> Resolved file path is "C:\Program Files (x86)\ArcGIS\DeveloperKit10.5\DotNet\ESRI.ArcGIS.Catalog.dll".
4> Reference found at search path location "{Registry:Software\Microsoft\.NETFramework,v4.7.2,AssemblyFoldersEx}".
4> For SearchPath "C:\...\bin\Release".
4> Considered "C:\...\bin\Release\ESRI.ArcGIS.Catalog.winmd", but it didn't exist.
4> Considered "C:\...\bin\Release\ESRI.ArcGIS.Catalog.dll", but it didn't exist.
4> Considered "C:\...\bin\Release\ESRI.ArcGIS.Catalog.exe", but it didn't exist.
4> For SearchPath "{TargetFrameworkDirectory}".
4> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\ESRI.ArcGIS.Catalog.winmd", but it didn't exist.
4> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\ESRI.ArcGIS.Catalog.dll", but it didn't exist.
4> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\ESRI.ArcGIS.Catalog.exe", but it didn't exist.
4> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\ESRI.ArcGIS.Catalog.winmd", but it didn't exist.
4> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\ESRI.ArcGIS.Catalog.dll", but it didn't exist.
4> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\ESRI.ArcGIS.Catalog.exe", but it didn't exist.
4> For SearchPath "{Registry:Software\Microsoft\.NETFramework,v4.7.2,AssemblyFoldersEx}".
4> Considered AssemblyFoldersEx locations.
4> Required by "C:\...\bin\Release\ArcBase.dll".
4> Found related file "C:\Program Files (x86)\ArcGIS\DeveloperKit10.5\DotNet\ESRI.ArcGIS.Catalog.xml".
4> The ImageRuntimeVersion for this reference is "v4.0.30319".