.NETStandard1.6 PCL的错误:“您的项目未引用“ .NETPlatform,Version = v5.0”框架”

编程入门 行业动态 更新时间:2024-10-19 04:29:46
本文介绍了.NETStandard1.6 PCL的错误:“您的项目未引用“ .NETPlatform,Version = v5.0”框架”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

为帮助重现此问题,需要采取以下步骤在Visual Studio 2015中创建.NETStandard1.6 PCL:

To help reproduce the problem, the following steps are taken to create a .NETStandard1.6 PCL in Visual Studio 2015:

  • 创建一个新的类库(可在iOS,Android和Windows上移植)。
  • 在其属性页面中,单击 Target .NET Platform Standard。
  • 将.NETStandard格式从.NETStandard1.1更改为.NETStandard1.6
  • 构建此空项目。
  • Create a new Class Library(Portable for iOS, Android and Windows).
  • In its Properties page, click "Target .NET Platform Standard".
  • Change .NETStandard form .NETStandard1.1 to .NETStandard1.6
  • Build this empty project.
  • 发生以下错误:

    >C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets(140,5): error : Your project is not referencing the ".NETPlatform,Version=v5.0" framework. Add a reference to ".NETPlatform,Version=v5.0" in the "frameworks" section of your project.json, and then re-run NuGet restore.

    以下是project.json:

    The following is project.json:

    { "supports": {}, "dependencies": { "Microsoft.NETCore.Portable.Compatibility": "1.0.1", "NETStandard.Library": "1.6.0" }, "frameworks": { "netstandard1.6": {} } }

    任何人都可以提供有关如何添加对 .NETPlatform,Version = v5.0在框架部分中?我尝试了以下操作:

    Could anyone offer a tip on how to Add a reference to ".NETPlatform,Version=v5.0" in the "frameworks" section? I tried the following:

    donet5.4:{}

    "donet5.4": {}

    donet5.0:{ }

    "donet5.0": {}

    都不行。

    推荐答案

    在VS2015末尾.csproj文件中,添加:

    For VS2015 at the very end of the .csproj file, add:

    <PropertyGroup> <NuGetTargetMoniker>.NETStandard,Version=v1.6</NuGetTargetMoniker> </PropertyGroup>

    更多推荐

    .NETStandard1.6 PCL的错误:“您的项目未引用“ .NETPlatform,Version = v5.0”框架”

    本文发布于:2023-11-14 19:46:21,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1588357.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:您的   框架   错误   项目   PCL

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!