We have three versions of the dotnet
command line interface installed:
C:\Program Files\dotnet\sdk> dir -name
1.0.0-preview2-003133
1.0.0-preview2-1-003177
1.0.0-preview3-004056
How can we choose which version to use when running for instance dotnet restore
? Right now the version is always the preview3
build.
Our PATH contains C:\Program Files\dotnet\
which contains:
host
sdk
shared
swidtag
dotnet.exe
LICENSE.txt
ThirdPartyNotices.txt
How do we choose which SDK the dotnet.exe
uses?
You can see both the SDK versions and runtime versions with the command dotnet --info . You'll also get other environmental related information, such as the operating system version and runtime identifier (RID).
The runtime includes everything you need to run . NET Core applications. The runtime is also included in the SDK.
The global. json file allows you to define which . NET SDK version is used when you run . NET CLI commands.
You choose which CLI you use by placing a global.json file into the current directory or a directory above it.
For example, to select 1.0.0-preview2-003133
, the file would look like this:
{
"sdk": { "version": "1.0.0-preview2-003133" }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With