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

编程入门 行业动态 更新时间:2024-10-19 06:25:15
本文介绍了.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).
  • 在其属性"页面中,单击目标 .NET 平台标准".
  • 将 .NETStandard 从 .NETStandard1.1 更改为 .NETStandard1.6
  • 构建这个空项目.
  • 出现以下错误:

    >C:Program Files (x86)MSBuildMicrosoftNuGetMicrosoft.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:07,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1588356.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:您的   框架   错误   项目   quot

    发布评论

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

    >www.elefans.com

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