Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have several versions of dotnet core in my system. But .Net Core project selects the latest version for building the project. Is there anything I can do to make sure that the project selects the correct version? I am using Visual Studio for development.

question from:https://stackoverflow.com/questions/66058856/how-to-make-dotnet-core-select-a-lower-version

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
289 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can create global files in the root folders where you want specific versions. You can run the following in the command line in the selected folder:

dotnet new global

This creates a new file called "global.json". You can open this file and edit the version number. You can list all available SDK versions using dotnet --list-sdks

Here he complete documentation on how you can set versions. You may want to consider using "latestFeature" or "latestPatch" (detailed in the documentation). These help as the hardcoded .net core SDK versions might change over time.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...