Reputation: 189
I'd like to create some new library for my applications with TargetFramework netcoreapp.
Is it possible to add this reference of .net core library to my UWP application? When I tried to add this reference I got this error message:
But I read that UWP application is part of .net core:
I don't have problem to add .net standard library to my UWP app but I don't think it is correct solution for that because .net core is already multi platform and implemented UWP. Or am I wrong?
Upvotes: 0
Views: 883
Reputation: 2358
When we create a cross-platform class library, we could use .NET Core
or .NET Standard
.
.NET Core is about the application being able to run on multiple platforms. Currently,.NET Core only supports two project types, Console and ASP.NET Core. Uwp is only for the Windows ecosystem, so you can’t create a uwp app and expect it run on other OS than Windows. If you compile the class library to target .NET Core, it can be only used by a .NET Core application.
.NET Standard is about sharing class library code between different .NET applications, such as WinForm, WPF, UWP,ASP.NET Core. Since they all have implemented some version of .NET Standard, which means that if the library is complied with a really low version(such as 1.0), the class library can be used by all.
In a word, for your issue, it is recommended to reference .net Standard class library to uwp application.
Upvotes: 3