-
-
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
NuGet package does not support UAP #44
Comments
The problem is, that QRCoder library targets the .NET-Framework. Those type of lib isn't supported by UWP apps. To use it in UWP context, I had to convert the QRCoder library to a PCL (Portable class library) which targets the .NET-Core framework. From my codebase this would be no problem, because all functions used in QRCoder should be also available in .NET Core. But when doing so, I would lose backwards compatibility, because PCLs work in the classic .NET world only with .NET 4 (with updates) and newer. So one solution would be to clone this project and open a new development tree where QRCoder is compiled as PCL. The I would add a second Nuget package (e.g. "QRCoder PCL") which could be used by UWP programmers, etc.. But then I had to manage changes in two code bases, so let me think a day or two if there isn't a better solution. Maybe one of the other QRCoder users has a better idea? |
https://github.com/JamesNK/Newtonsoft.Json has been doing this forever. The trick is to create the project file yourself so that they both (PCL/Full .NET) point to the same files on your file system. In the https://github.com/JamesNK/Newtonsoft.Json/tree/master/Src/Newtonsoft.Json folder you can see the multiple .csproj files. |
Hey @stevehansen - thanks for your input. This looks like a good solution. One more question: Do you also know, if it is possible, to deliver both library versions in one Nuget package? (Hereby I don't mean that both dlls will be referenced when installing the Nuget package, but that both are in Nuget package, so that Visual Studio can decide which one to reference, when installing the package.) |
Absolutely possible, NuGet works by checking the lib subfolders for certain named frameworks so that only those files are referenced depending on the current project in Visual Studio. I did this myself for a simple class library:
The different possible names are defined on the NuGet documentation: https://docs.nuget.org/create/targetframeworks So after the 2 projects are build you could have them copied to lib\net45 for full .NET framework and to lib\dotnet to support .NET core. |
That's perfect! Since I let build the solution automatically (triggered by Giothub commits) via MyGet (which also is used for publishing the "major versions" to NuGet), I only have to rewrite my build.bat and then UWP support will be given. |
Hi @stevehansen seems like I was a little bit to optimistic. QRCoder won't compile as PCL because it uses classes from the System.Drawing namespace (for the QRCode generation) which aren't available in PCL libraries. So do I really have to open a new development tree for each targeting platform with their platform dependent solution? I'm not adavanced in multiple platform development. Can anybody point me into the right direction? |
Added PCL support (and an UWP demo app) in the PR: #49 @chriszirkel could you please test if the current version (1.2.1) on NuGet works with your project? |
I tried to install the NuGet package in my UAP app but I get the following errors form the packagaing manager console:
Install-Package : QRCoder 1.1.9 is not compatible with UAP,Version=v10.0.
In Zeile:1 Zeichen:1
Install-Package : Some packages are not compatible with UAP,Version=v10.0.
In Zeile:1 Zeichen:1
Install-Package : QRCoder 1.1.9 is not compatible with UAP,Version=v10.0 (win10-arm).
In Zeile:1 Zeichen:1
Install-Package : Some packages are not compatible with UAP,Version=v10.0 (win10-arm).
In Zeile:1 Zeichen:1
Install-Package : QRCoder 1.1.9 is not compatible with UAP,Version=v10.0 (win10-arm-aot).
In Zeile:1 Zeichen:1
Install-Package : Some packages are not compatible with UAP,Version=v10.0 (win10-arm-aot).
In Zeile:1 Zeichen:1
Install-Package : QRCoder 1.1.9 is not compatible with UAP,Version=v10.0 (win10-x64).
In Zeile:1 Zeichen:1
Install-Package : Some packages are not compatible with UAP,Version=v10.0 (win10-x64).
In Zeile:1 Zeichen:1
Install-Package : QRCoder 1.1.9 is not compatible with UAP,Version=v10.0 (win10-x64-aot).
In Zeile:1 Zeichen:1
Install-Package : Some packages are not compatible with UAP,Version=v10.0 (win10-x64-aot).
In Zeile:1 Zeichen:1
Install-Package : QRCoder 1.1.9 is not compatible with UAP,Version=v10.0 (win10-x86).
In Zeile:1 Zeichen:1
Install-Package : Some packages are not compatible with UAP,Version=v10.0 (win10-x86).
In Zeile:1 Zeichen:1
Install-Package : QRCoder 1.1.9 is not compatible with UAP,Version=v10.0 (win10-x86-aot).
In Zeile:1 Zeichen:1
Install-Package : Some packages are not compatible with UAP,Version=v10.0 (win10-x86-aot).
In Zeile:1 Zeichen:1
Paketwiederherstellungsfehler für "TempCheckPiUI".
Install-Package : Fehler bei der Paketwiederherstellung. Es wird ein Rollback der Paketänderungen für "TempCheckPiUI" ausgeführt.
In Zeile:1 Zeichen:1
I could try to insert the code directly in my project but I would prefer to have the official package.
The text was updated successfully, but these errors were encountered: