Vahid Ghadiri
Vahid Ghadiri

Reputation: 4076

Upgrading an ASP.NET Core 2.0 application to ASP.NET Core 2.1 RC

Some days ago Microsoft announced .Net core 2.1 release candidate 1. [https://blogs.msdn.microsoft.com/dotnet/2018/05/07/announcing-net-core-2-1-rc-1/] [1]: How can I upgrade a .Net core2 project to 2.1 RC?

Upvotes: 0

Views: 1089

Answers (2)

Xeevis
Xeevis

Reputation: 4521

There are several steps that should be taken to upgrade from ASP.NET Core 2.0 application to 2.1.

  1. Change in the .csproj project file <TargetFramework>netcoreapp2.0</TargetFramework> to <TargetFramework>netcoreapp2.1</TargetFramework>.
  2. Replace the version specified Microsoft.AspNetCore.All package reference with the versionless Microsoft.AspNetCore.App package reference. You may need to add extra dependencies as several packages from All aren't included in the App package.
  3. Remove all references to <DotNetCliToolReference> elements
  4. In your Startup.cs change services.AddMvc(); to services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); (otherwise it defaults to 2.0)

Upvotes: 1

Chris Pratt
Chris Pratt

Reputation: 239260

You'll need the SDK installed (available here). You'll also need to be running at least VS2017 15.7, but considering 2.1 is still a release candidate, I'd stick with VS2017 Preview for the time being (available here).

Once you have all that, you simply need to edit your csproj file(s) and change the target framework to netcoreapp2.1.

<TargetFramework>netcoreapp2.1</TargetFramework>

The latest Microsoft.AspNetCore.All NuGet package should then download automatically during the rebuild.

Upvotes: 2

Related Questions