简体   繁体   English

都引用.NET标准类lib的.NET Windows窗体项目和UWP项目获得:

[英].NET windows forms project and UWP project that both reference .NET Standard class lib gets:

  1. I added both apps (framework 4.6.1) to same solution 我将两个应用程序(框架4.6.1)添加到了相同的解决方案中
  2. added a .NET Standard 2.0 class library 添加了.NET Standard 2.0类库
  3. referenced both apps to the class library. 将两个应用都引用到类库。

...and get: ...并获得:

ERROR... 错误...

Error NU1201 Project .NET Standard VB ClassLibrary1 is not compatible with uap10.0.15063 (UAP,Version=v10.0.15063). 错误NU1201 Project .NET Standard VB ClassLibrary1与uap10.0.15063(UAP,Version = v10.0.15063)不兼容。 Project .NET Standard VB ClassLibrary1 supports: netstandard2.0 (.NETStandard,Version=v2.0) UWP App1 C:\\PRIMARY\\WORK\\3 WindowsApp3\\UWP App1\\UWP App1.csproj 1 Project .NET Standard VB ClassLibrary1支持:netstandard2.0(.NETStandard,Version = v2.0)UWP App1 C:\\ PRIMARY \\ WORK \\ 3 WindowsApp3 \\ UWP App1 \\ UWP App1.csproj 1

But the apps Target framework drop down only allows .NET Framework xxx 但是应用程序Target framework下拉列表仅允许.NET Framework xxx
and the .NET Standard class library Target framework drop down only allows .NET Standard xx .NET Standard类库Target Framework下拉列表仅允许.NET Standard xx
so I can't make frameworks match. 所以我不能使框架匹配。

(This is on Visual Studio 2017 Pro on Windows 10 Pro.) (这是Windows 10 Pro上的Visual Studio 2017 Pro。)

All of the errors... 所有错误...

Here are the properties of the 2 app projects and the class lib project... 这是2个应用程序项目和类lib项目的属性...

在此处输入图片说明 在此处输入图片说明

在此处输入图片说明 在此处输入图片说明

在此处输入图片说明
在此处输入图片说明

You need to set the Min Version of your UWP project to 16299 (or higher). 您需要将UWP项目的最低版本设置为16299(或更高)。 Build 16299 was the first release that supports NET Standard 2.0. 内部版本16299是第一个支持NET Standard 2.0的版本。 Earlier versions of UWP are not compatible as the error message points out. 错误消息指出,UWP的早期版本不兼容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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