需要SignalR,在5月30日之前启动我的项目,当发布稳定版本的ASP .NET Core 2.1时,我选择使用ASP .NET Core 2.1 RC1.
但是,一旦发布了稳定版本,我自然希望抛弃预览版本并升级到稳定版本.该怎么做?
为了实现这一目标,我去了
Needing SignalR, having started my project before 30th May, when the stable version of ASP .NET Core 2.1 was released, I opted to use ASP .NET Core 2.1 RC1.
However, once the stable version is released, I'd naturally like to leave the preview version behind and upgrade to the stable version. How to do this?
In order to achieve that, I went to www.microsoft/net/download/visual-studio-sdks and downloaded .NET Core 2.1 x64 installer from there. However, having installed it, I cannot now compile my project. The compilation fails with the following errors:
NuGet package restore failed. Please see Error List window for detailed warnings and errors. 1>------ Build started: Project: mon, Configuration: Debug Any CPU ------ 1>C:\Users\m\source\repos\mon\mon\mon.csproj : warning NU1608: Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.CSharp.Workspaces 2.8.0-beta3 requires Microsoft.CodeAnalysis.CSharp (= 2.8.0-beta3) but version Microsoft.CodeAnalysis.CSharp 2.8.0 was resolved. 1>C:\Users\m\source\repos\mon\mon\mon.csproj : error NU1107: Version conflict detected for Microsoft.CodeAnalysis.Common. Reference the package directly from the project to resolve this issue. 1>C:\Users\m\source\repos\mon\mon\mon.csproj : error NU1107: mon -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.Mvc.Razor 2.1.0 -> Microsoft.CodeAnalysis.CSharp 2.8.0 -> Microsoft.CodeAnalysis.Common (= 2.8.0) 1>C:\Users\m\source\repos\mon\mon\mon.csproj : error NU1107: mon -> Microsoft.VisualStudio.Web.CodeGeneration.Design 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration.Core 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration.Templating 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration.Utils 2.1.0-rc1-final -> Microsoft.CodeAnalysis.CSharp.Workspaces 2.8.0-beta3 -> Microsoft.CodeAnalysis.Workspaces.Common 2.8.0-beta3 -> Microsoft.CodeAnalysis.Common (= 2.8.0-beta3). 1>Done building project "mon.csproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========How do I fix this?
Honestly, my current idea is to uninstall Visual Studio & all .NET Core SDK entries from Programs & Functions in Control Panel, then install it anew, create a new ASP .NET Core project, paste all source files I manually wrote from the old project to the new one... I suppose here must be a better way?
解决方案I was getting the same error message. I then tried, without success, to update the Microsoft.AspNetCore.App and Microsoft.NetCore.App NuGet packages and it told me I needed to remove the Microsoft.VisualStudio.Web.CodeGeneration.Design reference. This resolved the issue in my case.
更多推荐
如何从.Net Core 2.1 RC1升级到.NET Core 2.1的稳定版本?
发布评论