因此,我有一個快樂地工作的ASP.NET Core 1.0應用程序,目標是net461框架。將.NET Core應用程序升級到1.1的錯誤
今天我試着(按說明書on this page所有你需要做的是一個NuGet包升級)
這導致了錯誤的下列轉換將其升級到新的ASP.NET 1.1的核心:
error: Unable to resolve 'Microsoft.AspNetCore.Diagnostics.Abstractions (>= 1.1.0)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'Microsoft.AspNetCore.Hosting.Abstractions (>= 1.1.0)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'Microsoft.AspNetCore.Http.Extensions (>= 1.1.0)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'Microsoft.AspNetCore.WebUtilities (>= 1.1.0)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'Microsoft.Extensions.FileProviders.Physical (>= 1.1.0)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'Microsoft.Extensions.Logging.Abstractions (>= 1.1.0)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'Microsoft.Extensions.Options (>= 1.1.0)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'System.Diagnostics.DiagnosticSource (>= 4.3.0)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'System.Reflection.Metadata (>= 1.4.1)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'Microsoft.AspNetCore.Mvc.ApiExplorer (>= 1.1.0)' for '.NETFramework,Version=v4.6.1'.
error: Unable to resolve 'Microsoft.AspNetCore.Mvc.Cors (>= 1.1.0)' for '.NETFramework,Version=v4.6.1'.
...
我在這裏錯過了什麼?這不應該工作嗎?
僅供參考,這裏有project.json的相關章節(運行的NuGet升級前):
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.AspNet.WebApi.Client": "5.2.3"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"net461": {
"imports": [
]
}
}
編輯:運行的NuGet升級後,依賴關係部分是由Visual Studio改變了這種:
"dependencies": {
"Microsoft.AspNet.WebApi.Client": "5.2.3",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "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.Extensions.Options.ConfigurationExtensions": "1.1.0"
},
您是否下載了1.1 SDK/Tools? – Tseng
你可以在更新nuget包後發佈你的project.json依賴項部分嗎? – AdrienTorris
是的,安裝了1.1 SDK(在添加/刪除程序中顯示爲「Microsoft .NET Core 1.1.0-SDK 1.0.0 Preview 2.1-03177(x64)」) 另外,在帖子 – gallivantor