I see people scratching their heads over this a lot so am dropping it here even though I’m sure it’s stated in many places already.
When you are at the dotnet command line (aka the CLI aka Command Line Interface) and type ‘dotnet’ you will be shown the version of the runtime.
When you add the version parameter (‘dotnet –version’) that will return the version of the SDK (aka CLI aka Command Line Interface) that you are working with.
Here’s an example:
If you are confused, you’re not alone. There’s a good discussion/debate on GitHub about how to alleviate this confusion at What should dotnet –version display?
Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!
Yep this is confusing, I did wonder which set of confusing dotnet core version numbers you’d be talking about in this post, there are several sets to choose from.
Hey, I know .NET Core versioning can be very confusing. So confusing that you can still get it wrong after research. What dotnet –version shows is the version of the “host”. The text before the version string says “.NET Core Shared Framework Host”, which hints that this isn’t the version of .NET Core “Runtime”.
To quote the .NET Core bug discussion (https://github.com/dotnet/cli/issues/3773) about versioning:
> The host and the runtime are distinct components. 🙂 The runtime version is not displayed anywhere
That’s right: there’s no way to list the runtime version using a .NET Core command! You have to look inside the “shared” directory to find the version. On Linux, I use: ls /path/to/dotnet/shared/Microsoft.NETCore.App/ to list all the runtime versions available for that particular .NET Core installation.