.net core multi-switch environment, multiple versions sdk

Before telling .net core multi-version, we first understand how the connections and differences before the .net core sdk and .net core runtime, according to the official website of the interpretation we can simply interpreted as: sdk is used in the development process, and runtime is installed as the operating environment in the project release, runtime is a subset of skd

Then we have the following about the multiple versions of the sdk on a unified hosts, we how to choose a specific version of skd develop, debug and run it? About to know what version of skd choice, we must first know that those currently installed on the host sdk

  • windows: C: \ Program Files \ under dotnet \ sdk directory can check what kind of version

  • linux: ls /usr/share/dotnet/sdk/

  • If it is .net core 2.1 and later new version can be ordered by: view dotnet --list-sdks640?wx_fmt=png

After we determine the version (for example: 2.1.302), then we can be specified by global.json version of the sdk (global.json file created by dotnet new global.json, which were sdk version defaults to the current use of the latest sdk version)

{  
"sdk": {
      "version": "2.1.302"  } }

When dotnet command is executed, it will look in the current directory and the parent directory (would have been up to find, until you find, if not found, then the current system using the latest sdk installed to compile, run) global.json in the development of version

Original Address: https: //www.cnblogs.com/shermanli/articles/9379941.html

Guess you like

Origin www.cnblogs.com/z45281625/p/11362369.html