Unsupported error creating .net structure Class library

Just adding a new class library project (.net Core) to my solution will give you two errors:

Error NU1002 The dependency xxx.Web.Services 1.0.0 in the project xxx.Web.Services does not support the DNX framework, Version = v4.5.1.

Error NU1008 "netstandard1.5" is an unsupported infrastructure.

The contents of the project.json file:

{
    "version" : "1.0.0-*",

    "dependencies" : {
        "NETStandard.Library" : "1.5.0-rc2-24027"
    },

    "frameworks" : {
        "netstandard1.5" : {
            "imports" : "dnxcore50"
        }
    }
}

The contents of the Project.lock.json file:

{
    "locked" : false,
    "version" : 2,
    "targets" : {
        "DNX,Version=v4.5.1" : {
            "NETStandard.Library/1.5.0-rc2-24027" : {
                "type" : "package"
            }
        },
        "DNX,Version=v4.5.1/win7-x86" : {
            "NETStandard.Library/1.5.0-rc2-24027" : {
                "type" : "package"
            }
        },
        "DNX,Version=v4.5.1/win7-x64" : {
            "NETStandard.Library/1.5.0-rc2-24027" : {
                "type" : "package"
            }
        }
    },
    "libraries" : {
        "NETStandard.Library/1.5.0-rc2-24027" : {
            "type" : "package",
            "sha512" : "SD27bvP2gNnlpC7HZUbnPOXS1M7VbBZoi0bdlqe5tj7weJQ2EyGDGw8mi7K1yUmeqjL6jPWBLSC28TDaLnyqwA==",
            "files" : ["dotnet_library_license.txt", "NETStandard.Library.1.5.0-rc2-24027.nupkg", "NETStandard.Library.1.5.0-rc2-24027.nupkg.sha512", "NETStandard.Library.nuspec", "ThirdPartyNotices.txt"]
        }
    },
    "projectFileDependencyGroups" : {
        "" : ["NETStandard.Library >= 1.5.0-rc2-24027"]
    }
}
+4
source share
2 answers

You need to change the version in global.json (solution elements).

example:

{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-preview1-002702"
  }
}

may also need to change

 \DNX\Microsoft.DNX.Props –> \DotNet\Microsoft.DotNet.Props

\DNX\Microsoft.DNX.targets –> \DotNet.Web\Microsoft.DotNet.Web.targets

in your xproj file.

( ), , .

+2

RC2 .NET Core RC2 Tools Visual Studio 2015.

- Microsoft.NET Core.

0

All Articles