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.

Always provide existing version information in `dotnet workload list --machine-readable`, even if no update is available

See original GitHub issue

Is your feature request related to a problem? Please describe.

From a CI perspective, we need to be able to deterministically check whether a specific version of a given workload is installed. Currently we do this by locating the appropriate WorkloadManifest.json and verifying the version/etc from there. This is not ideal because it depends on implementation details that could change on us down the road.

Describe the solution you’d like

dotnet workload list --machine-readable provides JSON output that could solve this problem, but right now it is focused on updater scenarios. It only shows existingManifestVersion for a workload if there is an update available for it:

{
    "installed": [
        "macos",
        "ios"
    ],
    "updateAvailable": [
        {
            "existingManifestVersion": "12.0.101-preview.10.249",
            "availableUpdateManifestVersion": "12.0.101-preview.10.251",
            "description": ".NET SDK Workload for building macOS applications.",
            "workloadId": "macos"
        },
        {
            "existingManifestVersion": "15.0.101-preview.9.31",
            "availableUpdateManifestVersion": "15.0.101-preview.10.251",
            "description": ".NET SDK Workload for building iOS applications.",
            "workloadId": "ios"
        }
    ]
}

If no update is available, you only see something like this (no version information for macos workload):

{
    "installed": [
        "macos",
        "ios"
    ],
    "updateAvailable": [
        {
            "existingManifestVersion": "15.0.101-preview.9.31",
            "availableUpdateManifestVersion": "15.0.101-preview.10.251",
            "description": ".NET SDK Workload for building iOS applications.",
            "workloadId": "ios"
        }
    ]
}

Ideally, existingManifestVersion would have been in the installed array, regardless of any updates. To avoid changing behavior other tools might depend on, it’s probably necessary to add a new top-level property. Maybe something like this:

{
    "installed": [
        "macos",
        "ios"
    ],
    "updateAvailable": [
        {
            "existingManifestVersion": "15.0.101-preview.9.31",
            "availableUpdateManifestVersion": "15.0.101-preview.10.251",
            "description": ".NET SDK Workload for building iOS applications.",
            "workloadId": "ios"
        }
    ],
    "installedDetails": {
        "macos": {
            "manifestVersion": "12.0.101-preview.10.251"
        },
        "ios": {
            "manifestVersion": "15.0.101-preview.9.31"
        }
    }
}

Additional context

https://github.com/dotnet/sdk/issues/22148 is similar, but for users, not machines.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sfoslundcommented, Dec 2, 2021

@joeloff @dsplaisted @marcpopMSFT this should be easy to implement, putting it in the 6.0.2xx milestone.

0reactions
sandyarmstrongcommented, Mar 2, 2022

Wouldn’t dotnet workload update --print-rollback be better for this?

Playing with this again, it does not actually tell me whether the workloads are installed or not. So I need to either manually check manifests and pack directories to answer my question, or call two commands (workload update --print-rollback and workload list --machine-readable), one of which is slow because it always checks for updates, to get the information I need about what workload versions is installed (if any).

EDIT: Also one command uses the long form workload name and the other uses the short form. It’s very confusing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet workload update command - .NET CLI
The dotnet workload update command updates all installed workloads to the newest available versions. It queries Nuget.org for updated ...
Read more >
dotnet workload install command - .NET CLI
The dotnet workload list command compares the versions of installed workloads with the currently available versions. When it finds that a ...
Read more >
Troubleshoot known issues - .NET MAUI
Learn about .NET MAUI known issues and troubleshooting you can do to resolve these issues.
Read more >
Announcing .NET 6 - The Fastest .NET Yet - .NET Blog
NET 6 is now available. It is easier to use, runs faster, and has many new features.
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 >

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