Change Asp.Net Core version

Asked

Viewed 621 times

1

I installed version 3.0 of Asp.Net Core in my project, but I will need to change to an earlier one in the case of 2.2, there is some way to do this?inserir a descrição da imagem aqui

3 answers

1

First, you need to see if the desired version of . NET Core is installed. To do this, open the command prompt (cmd) and type:

dotnet --info

All versions of the SDK you have installed on will appear:

inserir a descrição da imagem aqui

If you do not have the desired version, you can download it here.

After verified that you have the desired version, right click on your project and select "Properties":

inserir a descrição da imagem aqui

In the Application tab, under "Target Framework", just select the desired version.

inserir a descrição da imagem aqui

0

It is possible to change from the file . csproj.

Right-click on the project, choose Unload Project. After the project gets disabled with the description (unloaded), click again and choose Edit Project File.

Find the tag:

<TargetFramework>netcoreapp3.0</TargetFramework>

change the value to netcoreapp2.2

<TargetFramework>netcoreapp2.2</TargetFramework>

Save the changes, close the file, click again on the project and choose Reload Project. Dependencies will be automatically restored to the desired version.

This method is also valid for other project types besides Asp.net core, and allows for example adding several output versions, which would allow compiling for both 2.2 and 3.0.

Below is the description of all versions:

https://docs.microsoft.com/pt-br/dotnet/standard/frameworks#supported-target-frameworks

0

Felipe, you can install the other version you need next to the current version. If your project does not run in v3.0, then it will run in v2.2. One installed version does not impact the operation of the other.

Follow the download link: https://dotnet.microsoft.com/download/dotnet-core

Browser other questions tagged

You are not signed in. Login or sign up in order to post.