【发布时间】:2016-11-24 04:38:14
【问题描述】:
我正在尝试将我的项目更新到 dotnet core 1.1。我安装了给定的 dotnet core SDK(确切地说是 1.0.0-preview2-1-003177)并创建了一个新的 Core WebAPI 项目,并根据升级文档中的给定更新了包。
error: Package Microsoft.AspNetCore.Mvc 1.1.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1).
Package Microsoft.AspNetCore.Mvc 1.1.0 supports:
error: - net451 (.NETFramework,Version=v4.5.1)
error: - netstandard1.6 (.NETStandard,Version=v1.6)
error: One or more packages are incompatible with .NETCoreApp,Version=v1.1.
这是我的 package.json
{
"dependencies": {
"Microsoft.AspNetCore.Authentication": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Logging": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.NETCore.App": "1.1.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
谁能帮我解决这个问题?
【问题讨论】:
-
知道了,global.json 中引用了旧的 sdk 版本。这就是问题所在。修复它:-) 添加解决方案
标签: asp.net asp.net-core .net-core