Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreCompat.System.Drawing dependency in 8.0.5+ versions causing System. conflicts #84

Open
harrisonwallace1 opened this issue Mar 6, 2024 · 3 comments

Comments

@harrisonwallace1
Copy link

Since the 8.0.5 version, the CoreCompat.System.Drawing package has been added to the NuGet dependencies.
This is causing issues in our .NET 8 application where that package is conflicting with built in framework features.

The type 'ICloneable' exists in both 'CoreCompat.System.Drawing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c0a7ed9c2333b592' and 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	
The type 'Color' exists in both 'CoreCompat.System.Drawing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c0a7ed9c2333b592' and 'System.Drawing.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Adding CoreCompat.System.Drawing to our project hasn't resolved the issue (as discussed in #74) as it is being bought in as a transiative dependency anyway.

This package looks like it has been referenced in the GlobalPayments.Api.csproj file since release: 0.0.3.4.

Is there a specific reason why this has been added as a dependency now? I am able to reproduce this error (see below) using a simple console app so the errors don't seem specific to our implementation.

NuGet Dependencies

GlobalPayments.Api 8.0.4

.NETStandard 1.3
Newtonsoft.Json (>= 9.0.1)
System.Net.Http (>= 4.3.0)
System.Net.Primitives (>= 4.3.0)
System.Net.Requests (>= 4.3.0)
System.Net.Sockets (>= 4.3.0)
System.Security.Cryptography.Algorithms (>= 4.3.0)
System.Xml.XmlDocument (>= 4.0.1)

GlobalPayments.Api 8.0.5

.NETStandard 1.3
CoreCompat.System.Drawing (>= 1.0.0-beta006)
NETStandard.Library (>= 1.6.1)
Newtonsoft.Json (>= 13.0.1)
System.IO.FileSystem (>= 4.3.0)
System.Net.Primitives (>= 4.3.0)
System.Net.Requests (>= 4.3.0)
System.Net.Security (>= 4.3.2)
System.Net.Sockets (>= 4.3.0)
System.Security.Cryptography.Algorithms (>= 4.3.0)
System.Threading.Thread (>= 4.0.0)
System.Xml.XmlDocument (>= 4.3.0)

Steps to Replicate

  • Create a new .NET 8 console app (also fails on .NET 6 and .NET 7)
  • Add the latest GlobalPayments.Api package
  • Create a class that implements ICloneable
    image
@SneyderOspinaChavarria
Copy link

SneyderOspinaChavarria commented Mar 6, 2024

Could you try adding this in your csproj file please?

<Target Name="ChangeAliasesOfNugetRefs" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
	<ItemGroup>
		<ReferencePath Condition="'%(FileName)' == 'CoreCompat.System.Drawing'">
			<Aliases>CoreCompatSystemDrawing</Aliases>
		</ReferencePath>
	</ItemGroup>
</Target>

@harrisonwallace1
Copy link
Author

Adding that target in does seem to resolve the build issues - thanks for that.
Out of interest, has something significantly changed in the package that now requires that dependency? I can see that it has been used internally for a long time but there is nothing in the release notes that indicate why it is required now.

@SneyderOspinaChavarria
Copy link

That dependency was already removed. You can try this version https://www.nuget.org/packages/GlobalPayments.Api/8.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants