question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What should dotnet --version display?

See original GitHub issue

Steps to reproduce

I installed .NET Core SDK for Windows. When I type dotnetin pwsh it showed

Microsoft .NET Core Shared Framework Host

Version : 1.0.1 Build : cee57bf6c981237d80aa1631cfe83cb9ba329f12 Usage: dotnet [common-options] [[options] path-to-application]

Common Options: –help Display .NET Core Shared Framework Host help. –version Display .NET Core Shared Framework Host version.

When I type `dotnet --version it shows

1.0.0-preview2-003121

Expected behavior

I don’t know what is expected behaviour.

Actual behavior

I have 2 different versions showing. One is 1.0.1 and the other one is 1.0.0-preview2-003121

Is this a bug? Microsoft .NET Core Shared Framework Host show different versions or first version is .NET Core version so the problem is only within label name?

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003121)

Product Information: Version: 1.0.0-preview2-003121 Commit SHA-1 hash: 1e9d529bc5

Runtime Environment: OS Name: Windows OS Version: 10.0.10240 OS Platform: Windows RID: win10-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:54 (45 by maintainers)

github_iconTop GitHub Comments

48reactions
vcsjonescommented, Nov 29, 2016

There have been a number of issues filed, confusion on Slack channels, and on twitter about the meaning of dotnet --version.

Proposal: dotnet --version should print all relevant information. Something like this:

CLI Tooling: 1.0.0-preview4-004130
Microsoft .NET Core Shared Framework Host: 1.1.0
MSBuild: 15.1.0.0

The only reason I could think of as why this would be a bad idea is if the output of --version was meant to be parsable / consumable by other tools.

21reactions
NickCravercommented, Jan 20, 2017

FWIW, I just tried to explain this to someone…and I couldn’t. They could not understand how things relate and how to correlate their --version to the website. I agree this really needs to change. People don’t develop in the .NET tooling, the .NET runtime, and the .NET SDKs. This is a migration painpoint because users have gone from:

I’m on .NET 4.6.2

to

I’m on: CLI: ________ SDK: _________ Runtime: _________

Basically we’ve replaced the .NET ecosystem with a bunch of exposed bits the user usually shouldn’t be caring about. While this was fine during the transition for the power users involved here, it is definitely not okay going forward. The least we can do would be to simplify the gap and make it easy for the user to access all the bits they’re on when getting help. Imagine what a user has to do on a build server to figure this out today. It’s not intuitive, and is a large step backwards which will hurt migrations to .NET Core. I really wish this would be reconsidered for 1.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Determine which .NET Framework versions are installed
The version of .NET Framework (4.5 and later) installed on a machine is listed in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET ...
Read more >
How to check .NET Framework version on Windows 10 and ...
Click the Details tab. In the "Product version" section, confirm the version of .NET – for example, 4.8.9032.0.
Read more >
What should dotnet --version display? · Issue #6569
NET Core Shared Framework Host show different versions or first version is .NET Core version so the problem is only within label name?...
Read more >
How to Determine Which Version of Microsoft .NET ...
1) Run command "regedit" from console to open Registry Editor · 2) Look for HKEY_LOCAL_MACHINE\Microsoft\NET Framework Setup\NDP · 3) All installed .NET Framework...
Read more >
4 Methods to Check .NET Framework Version on Windows
Method 3: Check .NET Framework Version in Registry · Open Start menu. · Search for “regedit” and click the “Registry Editor” app from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found