Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error after updating .net Core 1.0 to 1.1

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!

like image 927
Si Thu Avatar asked Nov 29 '16 10:11

Si Thu


2 Answers

Follow the steps of this article.

Probably you will have to add this code:

"dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version":  "1.1.0"
    }
}
like image 51
K1L3S Avatar answered Oct 24 '22 02:10

K1L3S


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": { }
  }
like image 2
idenardi Avatar answered Oct 24 '22 03:10

idenardi