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.

`dotnet --info` should also show workload info

See original GitHub issue

Background

The dotnet CLI tool has many command line options for showing info about what is installed:

sdk-options:
   ...
  --info            Display .NET information.
  --list-runtimes   Display the installed runtimes.
  --list-sdks       Display the installed SDKs.
  --version         Display .NET SDK version in use.

The most detailed of those options is --info, which includes the details of all the other top-level options, and looks like this:

.NET SDK:
 Version:   7.0.200
 Commit:    534117727b

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.200\

Host:
  Version:      7.0.3
  Architecture: x64
  Commit:       0a2bda10e8

.NET SDKs installed:
  3.1.426 [C:\Program Files\dotnet\sdk]
  6.0.309 [C:\Program Files\dotnet\sdk]
  7.0.200 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  ...
  Microsoft.WindowsDesktop.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

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

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

But wait, there’s even more info for workloads! The versions of workloads are fundamental regarding what is installed. Info on it is available via the dotnet workload list command:

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
maccatalyst                16.2.1035/7.0.100      VS 17.6.33417.168
runtimes-windows           7.0.3/7.0.100          VS 17.6.33417.168
maui-ios                   52.1.0/7.0.100         VS 17.6.33417.168
maui-windows               52.1.0/7.0.100         VS 17.6.33417.168
maui-maccatalyst           52.1.0/7.0.100         VS 17.6.33417.168
android                    33.0.39/7.0.100        VS 17.6.33417.168
ios                        16.2.1035/7.0.100      VS 17.6.33417.168
maui-android               52.1.0/7.0.100         VS 17.6.33417.168

Problem

Quite often when Microsoft receives bug reports we ask users to provide the output of dotnet --info, but for some scenarios that is incomplete information because of the lack of workload details. Then there is a back-and-forth between the customer and Microsoft to get additional details on workloads.

Proposed solution

I propose that dotnet --info also include the list of installed workloads.

The output could look something like this:

.NET SDK:
   ... various stuff ...

.NET SDKs installed:
  3.1.426 [C:\Program Files\dotnet\sdk]
  6.0.309 [C:\Program Files\dotnet\sdk]
  7.0.200 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  ...
  Microsoft.WindowsDesktop.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

.NET workloads installed: <-------------------------------------------------------------------- THIS IS THE NEW PART
  Installed Workload Id      Manifest Version       Installation Source
  ---------------------------------------------------------------------
  maccatalyst                16.2.1035/7.0.100      VS 17.6.33417.168
  runtimes-windows           7.0.3/7.0.100          VS 17.6.33417.168
  maui-ios                   52.1.0/7.0.100         VS 17.6.33417.168
  maui-windows               52.1.0/7.0.100         VS 17.6.33417.168
  maui-maccatalyst           52.1.0/7.0.100         VS 17.6.33417.168
  android                    33.0.39/7.0.100        VS 17.6.33417.168
  ios                        16.2.1035/7.0.100      VS 17.6.33417.168
  maui-android               52.1.0/7.0.100         VS 17.6.33417.168

Other architectures found:
  ... [more stuff]

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
baronfelcommented, Mar 2, 2023

While I appreciate the advantages of controlling this fully from SDK, there’s also some value to consistency. Note that we support dotnet --info even if there’s no SDK installed, in which case the entire output comes from the host. Would be nice if the two outputs were somewhat consistent.

I get that (and generally agree), but I also don’t think the current model lets us have a seamless layout of the runtime-provided parts, and the SDK-provided parts. I’m worried that if the SDK fills the screen with workload (and maybe CLI-environment-variable in the future?) related output, the useful output from the runtime will be pushed to the bottom and the overall layout won’t make sense to the user.

For now I think it’s ok for us to just add installed workload information to the SDK’s layout, but we should consider what better way of laying out/handshaking between the runtime and the SDK information here might look like.

1reaction
marcpopMSFTcommented, Apr 12, 2023

Resolving for now as it is fixed as requested but there may be a better design in the future but we’ll wait to get feedback.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet workload install command - .NET CLI
The dotnet workload list command compares the versions of installed workloads with the currently available versions.
Read more >
dotnet workload command - .NET CLI
Prints out detailed information about installed workloads, including their installation source, manifest version, manifest path, and install ...
Read more >
dotnet workload list command - .NET CLI
The dotnet workload list command lists all installed workloads. For more information about the dotnet workload commands, see the dotnet ...
Read more >
dotnet command - .NET CLI
The dotnet command has two functions: It provides commands for working with .NET projects. For example, dotnet build builds a project.
Read more >
Troubleshoot .NET tool usage issues
Discover the common issues when running .NET tools and possible solutions.
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