Change version Asp.Net Core

I installed version 3.0 of Asp.Net Core in my project, but I will need to change to a previous one in case a 2.2, do you have any way to do this?insert the description of the image here

Author: Felipe Arruda, 2019-11-29

3 answers

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

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

 0
Author: Victor Moraes, 2019-11-29 11:19:58

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:

insert the description of the image here

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

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

insert the description of the image here

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

insert the description of the image here

 0
Author: Leonardo Buta, 2019-11-29 12:22:04

You can change from the file .csproj.

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

Locate the tag:

<TargetFramework>netcoreapp3.0</TargetFramework>

Change the value to netcoreapp2. 2

<TargetFramework>netcoreapp2.2</TargetFramework>

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

This method is also valid for project types other than asp.net core, and allows for example to add multiple 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
Author: phduarte, 2020-12-19 04:14:44