Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
420 views
in Technique[技术] by (71.8m points)

asp.net - Package [some package] is not compatible with netcoreapp1.0

On dotnet restore we are receiving the following error:

Package Microsoft.AspNet.SomePackage 5.6.7 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.AspNet.SomePackage 5.6.7 supports: net45 (.NETFramework,Version=v4.5)

Our project.json looks like this:

{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },
  "dependencies": {
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
    "Microsoft.AspNet.SomePackage": "5.6.7",
    "Microsoft.NETCore.App": "1.0.0-*"
  },
  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "portable-net45+wp80+win8+wpa81+dnxcore50",
        "portable-net451+win8"
      ]
    }
  },
  "runtimes": {
    "win8-x64": {}
  }
}

How can we dotnet restore and dotnet run in a way that runs our app?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Note - by adding "net451" to the framework imports I was able to make it work.

"frameworks": {
   "netcoreapp1.0": {
      "imports": [
         "net451",
         "dotnet5.6",
         "portable-net45+win8"
       ]
   }
},

I took it from here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...