-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 only supported on Windows #354
Comments
Hi @mathiasnohall , thanks for pointing me there. Up to .NET 5.0 Short-term: Mid-term: |
Hi @mathiasnohall , I added net6.0 and net6.0-windows as targets and removed all System.Drawing dependencies from the net6.0 target. Can you please pick the latest CI-build and check if it's working for you? CI-Build Packages If you need help on how to use Github Packages as NuGet package source, let me know (or check this article). |
Hi @codebude, thanks for trying to solve this! tried it out and I can download the package from github nuget repo locally. However our code doesnt compile with the new version. We are creating a QRcode image from string input that is converted into a byte array.
maybe there is a better way? |
Hi @mathiasnohall ,
That's "clear" and expected. Since you target
Yes, there is. Just replace QRCode with PngByteQRCode renderer class. It doesn't depend on System.Drawing and returns a byte-array, so you don't have to do the conversion yourself. So for your example from your comment it would look like this: public byte[] GenerateQRCode(string input)
{
using var qrGenerator = new QRCodeGenerator();
using var qrCodeData = qrGenerator.CreateQrCode(input, QRCodeGenerator.ECCLevel.Q);
using var qrCode = new PngByteQRCode(qrCodeData);
return qrCode.GetGraphic(20);
} |
ok thanks! cool our CI pipe works now with jenkins and docker linux containers :) Just going to verify that the QR-code image turns out OK in our QA testings, that will take a couple of hours. the memory footprint of the final QR code byte array reduced from 16263 bytes to 726 bytes using the new code.. :) Thanks! |
Hi @mathiasnohall , thanks for your help and patience. I released QRCoder 1.4.3 right now: https://www.nuget.org/packages/QRCoder/ |
Just a quick question: have you tried if adding |
Type of issue
Request for new feature/improvement
Expected Behavior
QRCoder can be run in a linux docker container
Current Behavior
QRCoder can only be run in a windows docker container
As specified here:
https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only
System.Drawing.Common is only supported on Windows which is referenced by QRCoder.
We want to be able to run our service using QRCoder in our Kubernetes Cluster using linux containers. This cannot be done with this depencency.
The text was updated successfully, but these errors were encountered: