【发布时间】:2020-08-04 15:30:23
【问题描述】:
我已将 uap10.0 添加到 CSProj 文件(Net Core 项目)中的目标框架列表中,以便我可以从 UWP 项目中引用此库。
如下:-
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net462;uap10.0;xamarin.ios10;MonoAndroid70</TargetFrameworks>
</PropertyGroup>
</Project>
但是在构建时我收到以下错误消息:-
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets(84,5): error : Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='uap10.0'. They must be specified explicitly.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1111,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v10.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
我做错了什么?
谢谢。
【问题讨论】:
-
也许你想创建一个 .NET Standard 项目。
-
听起来很明智,但我如何添加所需的参考资料。与project.json系统不同。