Please use libraries with UWP support, such as https://github.com/codebude/QRCoder
System.Drawing depends on GDI+, which is an ancient Windows graphic API, so it is not available in UWP or other platforms.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This was not listed as one of the missing APIs for XBOX, and so I'm wondering what's up, and which API I should use in its place.
Context: I'm generating a QRCode using QRCoder to display.
From the logs:
Exception thrown: 'System.PlatformNotSupportedException' in System.Drawing.Common.dll
An exception of type 'System.PlatformNotSupportedException' occurred in System.Drawing.Common.dll but was not handled in user code
System.Drawing is not supported on this platform.
The code:
Bitmap bmp;
using (var ms = new MemoryStream(qrCode.GetGraphic(20)))
{
bmp = new Bitmap(ms); <==== Exception thrown here
}
Please use libraries with UWP support, such as https://github.com/codebude/QRCoder
System.Drawing depends on GDI+, which is an ancient Windows graphic API, so it is not available in UWP or other platforms.
I came across this same issue with Blazor Mobile Bindings.
Solution: Use the PCL version of QRCoder, such as BitmapByteQRCode-Renderer.