user4385532
user4385532

Reputation:

How can I upgrade from .Net Core 2.1 RC1 to the stable version of .NET Core 2.1?

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 https://www.microsoft.com/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?

Upvotes: 2

Views: 1095

Answers (1)

SunsetQuest
SunsetQuest

Reputation: 8817

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.

Remove Microsoft.VisualStudio.Web.CodeGeneration.Design reference under Dependencies under solution explorer

Upvotes: 7

Related Questions