简体   繁体   中英

Add reference .net core library to uwp application

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM