Conflicts between different versions of "System.Drawing.Common"

1481
2
Jump to solution
08-09-2022 07:53 AM
TomGeo
by
Occasional Contributor III

I migrated a project from AGP 2.9 to AGP 3.0 and it builds fine, though it comes back with a single warning MSB3277: Found conflict between different versions of "System.Drawing.Common" that could not be resolved.

The more detailed description is:
There was a conflict between "System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
"System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not.

I ran a build with a diagnostic log, but I cannot find out what part is still using version 4. I believe the pieces using version 6 are relatively clear:

  • ArcGIS.Desktop.Framework.dll
  • ArcGIS.Desktop.Core.dll
  • ArcGIS.Desktop.Mapping.dll
  • ArcGIS.Desktop.Editing.dll
  • ArcGIS.Desktop.Layouts.dll

Any suggestions on how I can get rid of this warning?

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Tom,

 The Migration tool (VSIX) only migrates your solution (or project file) from .Net Framework to .Net 6.0, it does not make changes to you any Nugets or dependent assemblies that are required by the move to .Net 6.0.   System.Drawing.Common is one of those dependent assemblies that requires a change when moving to .Net 6.0.  Under .Net Framework you used to be able to include a reference to System.Drawing.Common, but with .Net 6.0 you have to use the System.Drawing.Common Nuget (6.0.0) instead.  There is a sample called MultipatchBuilderEx that was migrated from 2.9 and it does show the final project composition that you are looking for:

Wolf_0-1660060384961.png

I think you might have to remove the old 4.0 reference to System.Drawing.Common and add the NuGet reference and you can't have both.

View solution in original post

2 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Tom,

 The Migration tool (VSIX) only migrates your solution (or project file) from .Net Framework to .Net 6.0, it does not make changes to you any Nugets or dependent assemblies that are required by the move to .Net 6.0.   System.Drawing.Common is one of those dependent assemblies that requires a change when moving to .Net 6.0.  Under .Net Framework you used to be able to include a reference to System.Drawing.Common, but with .Net 6.0 you have to use the System.Drawing.Common Nuget (6.0.0) instead.  There is a sample called MultipatchBuilderEx that was migrated from 2.9 and it does show the final project composition that you are looking for:

Wolf_0-1660060384961.png

I think you might have to remove the old 4.0 reference to System.Drawing.Common and add the NuGet reference and you can't have both.

TomGeo
by
Occasional Contributor III

Thanks Wolf, that was exactly what was needed. 🙂

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos