Hi,
We have a DLLs library that references ESRI DLLs and we upgrade it from version to version constantly (10.0 -> 10.X.X -> 10.6.1). This time we have a strange behaviour: at Rebuild it copies unexpected ESRI DLL files next to a target dll.
We assume that a setting “Copy Local” in Properties of a referenced DLL is a key to understand the issue.
Why are these additional ESRI DLLs included as a reference?
What is important: We have two our dlls (solutions): first and second.
The first has only ESRI references.
The second has a reference to the first and ESRI references.
The issue does not appear in the first. It appears in the second.
Any help will be greatly appreciated.
Solved! Go to Solution.
We think the key is a GAC,
and Visual Studio 2017 does not see the ESRI DLLs in the GAC when builds.
We have submitted to Microsoft community as well.
Visual Studio 2017 15.8.0 .Net 4.5 copies secondary reference/dependency - Developer Community
How could we set "CopyLocalDependenciesWhenParentReferenceInGac" to false?
You can set it in the project (.csproj)
<PropertyGroup>
<!-- Fix the default copy local behaviour changed in VS 2015 -->
<DoNotCopyLocalIfInGac>true</DoNotCopyLocalIfInGac>
</PropertyGroup>
See also: Behavior change for RAR Copy Local behavior when in the GAC · Issue #24 · Microsoft/msbuild · GitHub
Many thanks Sean. It really helped!!