Home > database >  How to switch the local version of .net core?
How to switch the local version of .net core?

Time:09-14

I downloaded the VS2022 for mac version,It seems to install the .net6 version of the environment for me by default, and I installed a 3.1 version myself. The local environment is as follows: enter image description here

How do I switch the default .net6 version to the 3.1 version?

CodePudding user response:

You can change the target framework version from project .csproj file and change the <TargetFramework>net6.0</TargetFramework> value to your .net version. Alternatively you can introduce a global.json to use a exact specified version for the solution/project, just place it in the project directory.

{
  "sdk": {
    "version": "3.1.100",
    "rollForward": "disable"
  }
}
  • Related