5
votes

I created new asp.net core web api project and updated to 1.1. I am getting following errors:

  1. The project has not been restored or restore failed - run dotnet restore WebApplication1 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets

  2. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.

  3. You may be trying to publish a library, which is not supported. Use dotnet pack to distribute libraries.

Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible causes: WebApplication1 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 262

Please advice!

2
Please show your: globals.json (from solution root), project.json, list of subdirectories under C:\Program Files\dotnet\sdkDmitry

2 Answers

6
votes

Follow the steps of this article.

Probably you will have to add this code:

"dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version":  "1.1.0"
    }
}
2
votes

You have to specify a runtimes section in your project.json file. In your project.json try to add the following section:

"runtimes": {
    "win10-x64": { }
  }