Closed wendt88 closed 7 years ago
Hi @wendt88 ,
the NuGet package contains three different binaries. They differ in their target frameworks.
There is...
Since most of the renderer classes like "QrCode", "Base64QrCode", etc. rely on Graphical methods which are only available in the full framework (.NET 4.0, etc.), those classes are missing in the PCL version. Let me quote the following part from the readme:
Besides the normal QRCode class (which is shown in the example above) for creating QR codes in Bitmap format, there are some more QR code rendering classes, each for another special purpose.
- QRCode*
- Base64QRCode*
- BitmapByteQRCode
- SvgQRCode*
- UnityQRCode*
(*) - Those classes are only available in the .NET Framework version. If you use the PCL version (e.g. for Universal apps), you have to use BitmapByteQRCode.
Since ASP.NET Core isn't a full .NET framework installation, the Nuget Package Manager automatically takes the PCL version.
This means, that you have two options:
Why aren't the other QrCode-renderers part of the PCL version?
Initially I wrote QrCoder for full .NET framework stack. Due to multiple requests the PCL version was added with the aim to target as most platforms as possible. So the PCL version can be used on Android devices, in .NET core, Windows Phone, etc. All of these target platforms have different implementations of Bitmap and Graphics classes. For this reason I'm unable to add the renderers, because I had to focus on a subset of functions which is share around all the platforms. And this was, until now, the byte[] containing the Bitmap data.
If you have some creative ideas, to bring the PCL library version to a new level, feel free to discuss them with the community or bring in your pull request.
Hi @codebude ,
How about this library? https://github.com/CoreCompat/CoreCompat Is it possible to use this library to make QRCoder supports Bitmap and Graphics?
Hi @qazq this would be an option to think about. Until now QrCoder comes as a single DLL solution without any dependencies. This benefit would get lost by using an external dependency. But let me think about it...
I personally think users should get a bitmap in memory and let the user connect up what they want. This QR code generator should be small.
@Hydroque so you prefer to keep the current solution?
Yes. Sorry for brevity. Was on phone. I would think that an extra class for it is a little bit overkill, as all that in necessary is a function that returns data in one go. Perhaps some shrinking is in order, but I haven't taken a full look at all the features this library has yet.
hi, is it possible, that this libraray isn't working on ASP.NET Core applications? I have installed it via NuGet and there are missing some classes. Ican create the qrCodeData, but there is no class to work with it (Base64QRCode etc)