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

System.Drawing.Common version conflict #308

Open
twinharbor opened this issue Jun 28, 2021 · 4 comments
Open

System.Drawing.Common version conflict #308

twinharbor opened this issue Jun 28, 2021 · 4 comments

Comments

@twinharbor
Copy link

I'm running into an issue trying to use this library. I made a brand new project and added the nuget and it won't compile.

The results show:
Found conflicts between different versions of "System.Drawing.Common" that could not be resolved.
There was a conflict between "System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "System.Drawing.Common, Version=4.0.0.2, 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=4.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not.
References which depend on "System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades/System.Drawing.Common.dll].
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades/System.Drawing.Common.dll
Project file item includes which caused reference "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades/System.Drawing.Common.dll".

To reproduce:

  • I created a new project for ios and android in xamarin. All latest versions, I believe.
  • I added nuget for System.Drawing.Common 5.0.2
  • Add nuget for QRCoder
  • Compile and the error pops up.

Versions I have here for reference:

  • Xamarin.forms 5.0.0.2012
  • NetStandard.Library 2.0.3
  • Visual Studio for Mac 8.10.3

thanks in advance for any insight!

@eliasribeiro
Copy link

Same problem here.

@mozesa
Copy link

mozesa commented May 17, 2022

I am facing with the same issue on Xamarin.Android (.NET 6).
QRCoder version: 1.4.3

  Assembly 'QRCoder' with identity 'QRCoder, Version=1.4.3.0, Culture=neutral, PublicKeyToken=c4ed5b9ae8358a28' uses 'System.Drawing.Common, Version=4.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' which has a higher version than referenced assembly 'System.Drawing.Common' with identity 'System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

Update

        using (QRCodeGenerator qrGenerator = new QRCodeGenerator())
        using (QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q))
        using (QRCode qrCode = new (qrCodeData))
        {
            // Bitmap qrCodeImage = qrCode.GetGraphic(20);
        }

When I comment out this Bitmap qrCodeImage = qrCode.GetGraphic(20);, it throws no error.

@CrewNerd
Copy link

CrewNerd commented Aug 1, 2022

Same problem here - has anyone found a workaround?

@twinharbor
Copy link
Author

I wound up abandoning use of this entirely. I found BarcodeScanner.XF for scanning codes and I didn't wind up needing to generate codes within Xamarin in my case.

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

4 participants