How components in .NET Core are versioned.
.NET Core consists of multiple components that are each versioned independently and can often be mixed and matched.
Shared Framework. This contains the APIs and the Virtual Machine and other runtime services needed for running .NET Core applications.
The current .NET Core Virtual Machine is called CoreCLR. This executes the .NET bytecode by compiling it JIT and provides various runtime services including a garbage collector. The complete source code for CoreCLR is available at https://github.com/dotnet/coreclr.
The .NET Core standard APIs are implemented in CoreFX. This
provides implementations of all your favourite APIs such as
System.Runtime
, System.Theading
and so on. The source code for
CoreFX is available at https://github.com/dotnet/corefx.
Host is also called the muxer or driver. This components
represents the dotnet
command and is responsible for deciding what
happens next. The source for this is available at
https://github.com/dotnet/core-setup.
SDK is also sometimes called the CLI. It consists of the
various tools (dotnet
subcommands) and their implementations that
deal with building code. This includes handling the restoring of
dependencies, compiling code, building binaries, producing packages
and publishing standalone or framework dependent packages. The SDK
itself consists of the CLI, which handles command line operations
(at https://github.com/dotnet/cli) and various subprojects that
implement the various operations the CLI needs to do.
Various official and unoffical packages, tarballs, zips and installers for .NET Core (including those available on https://dot.net/core) provide .NET Core in many variants. Two common ones are SDKs and Runtimes.
Each SDK install or Runtime install contains a number (possibly 0) of hosts, sdk and shared framework components described above.
.NET Core Runtime contains
.NET Core SDK contains
Each .NET Core component (SDK, Host and Shared Framework) is versioned independently.
You can find the version for each of them separately.
SDK
You can use the --version
option to dotnet
to see the SDK
version. For example:
$ ~/dotnet-1.1.1/dotnet --version
1.0.0-preview2-1-003176
dotnet --info
also shows the SDK version.
Host
You can run dotnet
by itself without any arguments or options to
see the version of the host.
$ ~/dotnet-1.1.1/dotnet
Microsoft .NET Core Shared Framework Host
Version : 1.1.0
Build : 362e48a95c86b40cd1f2ef3d08741f7fed897956
Usage: dotnet [common-options] [[options] path-to-application]
...
Shared Framework
There no command currently to display the avaialble shared
frameworks. I use ls /path/to/where/you/installed/dotnet/shared/Microsoft.NETCore.App
which relies on internal implementation details. For example:
$ ls ~/dotnet-1.1.1/shared/Microsoft.NETCore.App/
1.1.1
It's possible to have multiple .NET Core SDKs and Runtimes available on disk. You can select the versions for each separately.
To select the version of the SDK to use, use global.json
.
To select the version of the shared framework to use, target the specified framwork in the .csproj
file (or project.json
if you are still using that).