11
votes

I have a .NET Core class library, targeting .NET Standard 1.6.

I want to make a small Windows app with a GUI I can use to test various capabilities of my class library. At this point, I don't particularly care if it's WPF or Universal.

I've tried adding both project types (WPF and UWP) to the solution using the available templates in Visual Studio 2017 RC, but when I try to build either I get compatibility errors e.g.

.NETStandard,Version=v1.6... cannot be referenced by a project that targets UAP,Version=v10.0.10586

.NETStandard,Version=v1.6... cannot be referenced by a project that targets .NETFramework,Version=v.4.5.2

Which makes sense, but I can't figure out how to make any sort of GUI app at all that can use a .NET Core class library.

1

1 Answers

10
votes

Check out this table here : https://github.com/dotnet/standard/blob/master/docs/versions.md

Or in image form :

enter image description here

So you are using UWP version 10, you can only use libraries that use .net standard 1.4. For the .net framework version 4.5.2 you can only use .net standard 1.2.

Developers making libraries on the .net standard should try and keep the version as low as possible so that as many frameworks as possible can use it, but that's not always happening. And to be fair to them, A LOT was missing in those early versions of .net standard.

If you are in control of the class library, you should lower the .net standard targeting version if that's possible (e.g. You don't use anything from higher versions). If the class library is from someone else, you may be out of luck.