Skip to content

dotnet should report .NET not MSBuild version #37713

@richlander

Description

@richlander

Proposed:

$ dotnet build
.NET SDK 8.0.100 (preview; linux-x64; 57efcf1350)
  Determining projects to restore...
  All projects are up-to-date for restore.
  app -> /home/rich/app/bin/Debug/net8.0/app.dll
$ dotnet --info
.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.2d90560f
 MSBuild: 17.8.3+195e7f5a3
 NuGet: 6.8.0.32767

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  23.10
 OS Platform: Linux
 RID:         ubuntu.23.10-x64
 Base Path:   /usr/lib/dotnet/sdk/8.0.100/

.NET workloads installed:
 Workload version: 8.0.100-manifests.2d90560f
There are no installed workloads to display.

Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  8.0.100 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.0 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Existing:

$ dotnet build
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  app -> /home/rich/app/bin/Debug/net8.0/app.dll

There are four key ideas there:

  • Switch to reporting .NET version instead of MSBuild version (which is confusing/not useful).
  • Add some variation of "preview" or "pre-release" to that same static line; we don't need to use MSBuild for that.
  • Optionally add some more useful information to that same line so that people reporting issues naturally share more information to aid diagnosis.
  • Move MSBuild information to dotnet --info and consider adding additional versions there, like NuGet.

Provides a solution for #34526.

@baronfel @jaredpar @aortiz-msft

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions