You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将ASP.NET Core 2.0应用程序升级至ASP.NET Core 2.1 RC?

Hey there! Upgrading your .NET Core 2.0 project to .NET Core 2.1 RC 1 is straightforward once you follow these steps:

Upgrade .NET Core 2.0 to 2.1 RC 1: Step-by-Step Guide

1. Install the .NET Core 2.1 RC 1 SDK

First things first—you need to have the latest RC SDK installed on your machine. This lets you compile and run .NET Core 2.1 projects properly.

2. Update Your Project File (.csproj)

This is the core part of the upgrade. Open your project's .csproj file and make these key changes:

Update the Target Framework

Find the <TargetFramework> element and switch its value from netcoreapp2.0 to netcoreapp2.1:

<!-- Before -->
<TargetFramework>netcoreapp2.0</TargetFramework>

<!-- After -->
<TargetFramework>netcoreapp2.1</TargetFramework>

Update NuGet Package References

If your project uses meta-packages like Microsoft.AspNetCore.App or Microsoft.NETCore.App, update their versions to match the RC release:

<!-- Before -->
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.0.*" />

<!-- After -->
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-rc1-final" />

Alternatively, you can use the .NET CLI to update packages directly:

dotnet add package Microsoft.AspNetCore.App --version 2.1.0-rc1-final

3. Update Global Tools (If Applicable)

If you’re using global tools like dotnet-ef, don’t forget to update them to the RC version too:

dotnet tool update --global dotnet-ef --version 2.1.0-rc1-final

4. Verify the Upgrade

To confirm everything works as expected:

  • Run dotnet --version in your terminal—you should see the 2.1 RC SDK version (e.g., 2.1.300-rc1-008673)
  • Run dotnet build to compile your project, then dotnet run to test if it launches without errors

内容的提问来源于stack exchange,提问作者Vahid Ghadiri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:12:03