Note: This article is published on 09/30/2024.

These two articles are to upgrade .Net Core Web App from lower version (5.0 and 3.1) to 8.0. There are two ways to go, one is manually, another one following MS Upgrade Assistant.

A - Introduction

This article will discuss the Upgrading from .Net 5.0, 7.0 or 3.1 to .Net 8.0. We use the Microsoft Visual Studio extension, Upgrade Assistant, to do the task and compare the result with the reault from manual method, introduced from the part 1 of this series of article: Upgrade .Net Core Web App from .Net 5.0 (3.1) to 8.0 --- Manually.

The content of the article includes:

B - Install the Visual Studio extension --- Upgrade Assistant

The .NET Upgrade Assistant can be installed as a Visual Studio extension, which lets you upgrade an opened project. Use the following steps to install the .NET Upgrade Assistant from inside Visual Studio. Alternatively, you can download and install the extension from the Visual Studio Marketplace.

C - Upgrade Assistant Features

Supported languages

Supported projects

Upgrade paths

D - Upgrade with the Visual Studio extension

After you've installed the .NET Upgrade Assistant extension, right-click on the project in the Solution Explorer window, and select Upgrade.

A tab is opened which provides, based on your project type, different styles of upgrade:

In our case, we use Git to manage different versions and different branches, so we just choose the In-Place Project upgrade:

The next, we choose the version we will upgrade to. Now, it it version 8 as current:

The next, choose components to upgrade, this seems does not make any sense, we usually choose all of them => Click Update selection to start to update:

Once your app has been upgraded, a status screen is displayed which shows all of the artifacts related to your project that were associated with the upgrade. Each upgrade artifact can be expanded to read more information about the status. Such as, in our case:

The following list describes the status icons:

In our case, there are three Filled green checkmark:

Those indicates the artifact was upgraded and completed successfully, while the others are all Unfilled green checkmark: The tool didn't find anything about the artifact to upgrade.

The upgrade is done, and successful --- compilable, at least for this case.

E - Evaluation of the Upgrade Assistant Method

In this evaluation, we will evaluate the effects and correctness of the Upgrade Assistant Method, and compare it with the manual method, introduced from article: Upgrade .Net Core Web App from .Net 5.0 (3.1) to 8.0 --- Manually.

Sample 1: --- diff

For the case above, we got the changed files from Git:

We can see, the only upgrade is the

while the same app, if we use the manual method to upgrade, which will upgrade both TargetFramework and Package references, the result is

Compared, we can see, the Upgrade Assistant method is only equivalent to the manual method the first step: Upgrade the .Net Version, or the TargetFramework, without updating the Package References.

Sample 2: --- same, good

The following two cases, they are exactly the same by both Upgrade Assistant or manual method.

Upgrade Assistant:

Manually:

This is a very simple sample, only TargetFrame needs to be upgraded, so they are the same.

Sample 3: --- same, good

Upgrade Assistant:

Manually:

This sample, only involved for upgrading are Microsoft Entity Framework, besides the TargetFramework. So, Upgrade Assistant can handle correctly.

Sample 4: diff

Upgrade Assistant:

Manually

Sample 5: diff, Assistant changes more

Upgrade Assistant:

Manually

In this case, Upgrade Assistant made more modifications shown in the graph above in red frames, further more, it changed some code: added code:

However, it will causes more errors, even not happened in the Manually Method, such as

Summary of E, the comparisons between Manual Upgrade Method and the Upgrade Assistant.

Conclusion:

These two ways are almost equivalent,

They may be used independently, or used together to make a better solution.

References: