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?
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
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:
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":
In the Application tab, under "Target Framework", simply select the desired version.
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