Critical dependency issue - Unexpected ESRI DLL files copied next to a target dll

2170
14
Jump to solution
10-28-2018 08:45 PM
MarkMindlin
Occasional Contributor III

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.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

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 

View solution in original post

14 Replies
by Anonymous User
Not applicable

Hi Mark,

Make sure "Embed Interop Types" is set to false for Esri assemblies in their properties, otherwise you'll get a copy in the local path.

0 Kudos
MarkMindlin
Occasional Contributor III

Thanks Sean,

We made sure it is. But still the same issue.

0 Kudos
by Anonymous User
Not applicable

And copy local is false? and you still get the dll in the target path?

0 Kudos
MarkMindlin
Occasional Contributor III

Yes. Please see the image attached.

0 Kudos
MarkMindlin
Occasional Contributor III

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.

0 Kudos
by Anonymous User
Not applicable

The only way i can repro this is by setting the "reference to the first project" in the second project to copy local = true, then all the esri references get copied in. Actually this happens if any of the esri references are set to true also.

beats me. Unless anybody else chimes in here you might have to go through (developer) support.

0 Kudos
MarkMindlin
Occasional Contributor III

Thanks Sean,

We have esri references set to false (all properties: "Copy Local", "Embed Interop Types" and "Specific Version") as you see on the image above. For all references across the first and the second solution. Yes, in the second, we should have the reference to the first "Copy Local" = true.

Little hope that support could help.

0 Kudos
MarkMindlin
Occasional Contributor III

We reproduced it in a small demo in Visual Studio 2017. Please see attached zip at the topic "SecondProjectReference.zip" with two simple solutions.

0 Kudos
MarkMindlin
Occasional Contributor III

We have compared Visual Studio 2017 and Visual Studio 2013 for the demo.

With MSBuild reports, the log output are different

(In Visual Studio, go to Tools > Options > Projects and Solutions > Build and Run. Change the "MSBuild project build output verbosity" setting to Detailed. Now clean and rebuild your project. )

//////////////////////////////////////////

For 2017

1> Dependency "ESRI.ArcGIS.Geodatabase, Version=10.6.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86".
1> Resolved file path is "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet\ESRI.ArcGIS.Geodatabase.dll".
1> Reference found at search path location "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet".
1> For SearchPath "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet".
1> Considered "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet\ESRI.ArcGIS.Geodatabase.winmd", but it didn't exist.
1> Required by "ESRI.ArcGIS.ADF.Local, Version=10.6.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86, processorArchitecture=MSIL".
1> Required by "BaseLibrary1".
1> Found related file "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet\ESRI.ArcGIS.Geodatabase.xml".
1> The ImageRuntimeVersion for this reference is "v4.0.30319".

///////////////////////////////////////////

For 2013

1> Dependency "ESRI.ArcGIS.Geodatabase, Version=10.6.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86".
1> Resolved file path is "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet\ESRI.ArcGIS.Geodatabase.dll".
1> Reference found at search path location "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet".
1> For SearchPath "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet".
1> Considered "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet\ESRI.ArcGIS.Geodatabase.winmd", but it didn't exist.
1> Required by "ESRI.ArcGIS.ADF.Local, Version=10.6.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86, processorArchitecture=MSIL".
1> Required by "BaseLibrary1".
1> Found related file "C:\Program Files (x86)\ArcGIS\DeveloperKit10.6\DotNet\ESRI.ArcGIS.Geodatabase.xml".
1> This reference is not "CopyLocal" because it's registered in the GAC.
1> The ImageRuntimeVersion for this reference is "v4.0.30319".

 

0 Kudos