在UWP和ASPNETCORE应用程序上使用什么类库作为参考 [英] What class library to use to be reference on UWP and ASPNETCORE apps
问题描述
我想创建一个可以在我的aspnetcore应用程序和uwp应用程序上使用的类库.
I would like to create a class library that can be used on my aspnetcore app and uwp app.
如果我错了,请纠正我,以我理解下图的方式(第一张图),我可以创建一个.net核心类库,并将其引用到uwp和aspnetcore.
Please correct me if I'm wrong, the way I understand the image below (first image) I can create a .net core class library and have it reference to uwp and aspnetcore.
我创建的是.NET Core Class Library
,Aspnet Core Web App
和UWP
.
我尝试在Aspnet Core Web App
上引用.Net Core Class Library
,没有错误.现在,我尝试在UWP
上引用.Net Core Class Library
,它显示了下面的错误(最后一张图片).
I tried to reference .Net Core Class Library
on my Aspnet Core Web App
, no errors. Now, I tried to reference .Net Core Class Library
on my UWP
and it showed the error below (last image).
我最好改为创建PCL,如所述在这里?
Am I better of creating PCL instead as stated here?
PS.我正在使用VS2015 Update 3
PS. Im using VS2015 Update 3
推荐答案
该工具现已在Visual Studio 2017发行候选版本中提供.现在,您可以从模板创建.Net Standard类库,并使用它来促进Asp.Net Core应用程序与通用Windows平台(UWP)应用程序之间的代码共享(例如模型对象).
The tooling is now available in Visual Studio 2017 release candidate. You can now create a .Net Standard class library from a template and use this to facilitate sharing code (e.g. model objects) between an Asp.Net Core app and a Universal Windows Platform (UWP) app.
.Net标准类库被认为是可移植类库(PCL)的后继者.
.Net Standard class library is considered the successor to the portable class library (PCL).
这篇关于在UWP和ASPNETCORE应用程序上使用什么类库作为参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!