Error after updating .net Core 1.0 to 1.1
Asked Answered
C

2

5

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!

Creator answered 29/11, 2016 at 10:23 Comment(1)
Please show your: globals.json (from solution root), project.json, list of subdirectories under C:\Program Files\dotnet\sdkMidgett
B
6

Follow the steps of this article.

Probably you will have to add this code:

"dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version":  "1.1.0"
    }
}
Balmacaan answered 29/11, 2016 at 11:49 Comment(1)
Yes! This fixed the issue for me. For whatever reason, my project.json file had "Microsoft.NETCore.App": "1.1.0" in the dependencies section; I removed that. I really need to learn more about the actual implementation of all this. But since project.json is going away... hopefully I can wait until there's just one new model to learn. :)Portrait
H
2

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": { }
  }
Horn answered 30/11, 2016 at 1:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.