This article is a mirror article of machine translation, please click here to jump to the original article.

View: 54701|Reply: 2

[Source] .NET sets the default SDK version

[Copy link]
Posted on 2021-3-30 13:59:27 | | | |
If you have multiple .NET Core SDKs installed on your computer, you can view them using the following commands:


Check the version commands currently in use:


After the dotnet SDK is installed, the program will automatically set the C:\Program Files\dotnet\folder is added to the system environment variable, and then the project can be created and run through the dotnet command.



SDK commands include dotnet new and dotnet run. The .NET CLI must select an SDK version for each dotnet command. It defaults to the latest SDK installed on your computer, even if:
During the development process, we wanted to re-select the version used by dotnet and set the default version.

Solution:

In the C:\Users\Username directory (C:\Users\itsvse_nuc\), create a new global.json file with the following configuration:

global.json can be placed anywhere in the file hierarchy. The CLI searches up from the project directory for the first global.json it finds. The user controls which items are applied to a given global.json by their location in the file system. The .NET CLI navigates up from the current working directory path to iteratively search for global.json files. The first global.json file found specifies the version to use. If you already have that SDK version installed, use that version. If the SDK specified in global.json is not found, the .NET CLI will use matching rules to select a compatible SDK, and if it cannot be found, it will fail.

Once set, the effect is as follows:



Resources:

The hyperlink login is visible.
The hyperlink login is visible.





Previous:.NET/C# Rule Engine RulesEngine tutorial
Next:Jenkins (2) Windows Reset Password Tutorial
Posted on 2022-11-11 10:14:25 |
testtesttesttest
Posted on 2023-4-12 14:27:37 |
The author is amazing, take a look
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com