Hi @oracle 0133 , Welcome to Microsoft Q&A.
If you want to migrate the installation path of dotnet SDK 7.0.201, together with other dotnet SDK versions, then you should migrate to "C:\Program Files\dotnet\sdk" (not only the installation path changes, but also the Windows registration table has also changed). Here are two dotnet SDKs on my computer at the same time:
At this time, the dotnet in the system environment variable path is "C:\Program Files\dotnet". At this time, there are two versions of dotnet SDK under this path. At this time, you open CMD and enter "dotnet --version" and you will find that the result is a newer dotnet SDK version. Because there are two versions of dotnet SDK under this path, the system will recognize the dotnet SDK with a newer version number by default.
At this point, if you want to specify the dotnet SDK version for the project, you can do the following:
Open cmd in the root directory of the project and execute the command:
dotnet new globaljson --sdk-version "sdk version number" --force
Here is my example:
Best Regards,
Wenbin
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.