Skip to content

QRCode class is missing under Linux since 1.4.3 #443

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

Closed
ghost opened this issue Jan 24, 2023 · 5 comments
Closed

QRCode class is missing under Linux since 1.4.3 #443

ghost opened this issue Jan 24, 2023 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 24, 2023

Type of issue

Bug, showstopper-class

Expected Behavior

Code (see below) compiles

Current Behavior

You'll get an error about "class QRCode is not defined".

Possible Solution (optional)

Probably to change something near the
#if NET6_0_WINDOWS [System.Runtime.Versioning.SupportedOSPlatform("windows")] #endif

Steps to Reproduce (for bugs)

Just use a simplest code from example:

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

and try to compile in under Linux and .NET 6.0

Your Environment

  • Version used: 1.4.3
  • Compiled from source or NuGet package?: NuGet
  • Payload/Encoded text:
  • Used payload generator:
  • Used ECC-level:
  • Used renderer class:
  • Environment (.NET 3.5, .NET 4.X, .NETCore, ...): .NET Core 6 under Fedora 37
@user-named-void
Copy link

I have the same issue with windows and .NET 6 in 1.4.3. Downgrading to 1.4.2 solves the issue.

@OptimusPi
Copy link

I have the same issue on .NET 6 on version 1.4.3

Only upgraded to QRCoder 1.4.3 via a Snyk PR - apparently v1.4.2 has RCE exploit possible: https://security.snyk.io/vuln/SNYK-DOTNET-SYSTEMDRAWINGCOMMON-3063427

@OptimusPi
Copy link

OptimusPi commented Jan 31, 2023

p.s. There is an issue that talks about this, read here: #361 (comment)

@Jesn
Copy link

Jesn commented Jul 3, 2023

@user-named-void So am I. According to what you said, demoting to 1.4.2 is indeed possible

@MarkusG MarkusG mentioned this issue Nov 28, 2023
@codebude
Copy link
Owner

Microsoft removed System.Drawing support in .NET 6 for non-Windows platforms. Since the QRCode renderer uses System.Drawing, it's correct that it isn't supported on Linux. But that must not be a problem as there are other rendering classes that are supported on non-Windows platforms. Check the compatibility matrix to find a renderer that fits your platform/environment: https://github.com/codebude/QRCoder/wiki/Advanced-usage---QR-Code-renderers#2-overview-of-the-different-renderers

Long-term we plan to move away from System.Drawing and replace it by another graphics library.

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