Error for .NETStandard1.6 PCL: "Your project does not reference" .NETPlatform, Version = v5.0 "framework"

To reproduce the problem, follow these steps to create PCL.NETStandard1.6 in Visual Studio 2015:

  • Create a new class library (Portable for iOS, Android, and Windows).
  • On the Properties page, click Target.NET Platform Standard.
  • Change form of .NETStandard.NETStandard1.1 to .NETStandard1.6
  • Create this empty project.

The following error has occurred:

>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.

The following is the project.json command:

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

Can anyone offer advice on adding a link to ".NETPlatform, Version = v5.0" in the "frameworks" section? I tried the following:

"donet5.4": {}

"donet5.0": {}

Nothing works.

+4
2

VS2015 .csproj :

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

, project.json

"frameworks": {
            "netstandard1.4": {
                "imports": "portable-net45+win8+wpa81+wp8"
            }
            "netplatform50": {}
  }

0

Source: https://habr.com/ru/post/1666955/


All Articles