Skip to content

[DevServer CLI] disco: tell a not-yet-restored Uno.Sdk apart from one that cannot be restored #25497

Open

Description

@carldebilly

Summary

When the Uno.Sdk version pinned in global.json is not in the local NuGet cache, uno.devserver disco gives the same answer in two different situations:

  • the version simply hasn't been restored yet (a restore will fix it);
  • the version can't be restored from the configured sources at all (for example, a version that only exists on a private or internal feed).

The error doesn't say which case applies:

"unoSdkVersion": "6.7.12",
"unoSdkPath": null,
"errors": [ "Uno SDK package not found in NuGet cache: Uno.Sdk 6.7.12." ]

The CLI exits with code 1 and the dev server never starts. IDEs show this string as is, so the user can't tell that the fix is to change global.json.

Repro

  1. Pin a Uno.Sdk version in global.json that isn't on nuget.org (here 6.7.12; the public 6.7 versions are 6.7.18, 6.7.22 and 6.7.30).
  2. Use an empty NuGet cache and a nuget.config containing only nuget.org.
  3. dotnet dnx -y uno.devserver -- disco --solution <app>.sln --json → exit 1 after about 10 s, with the error above.

For comparison, MSBuild's SDK resolver on the same project gives the actionable message:

Unable to find package Uno.Sdk with version (= 6.7.12)
  - Found 1473 version(s) in nuget.org [ Nearest version: 6.7.18 ]
error MSB4236: The SDK 'Uno.Sdk' specified could not be found.

With global.json set to 6.7.30 and after a restore, disco succeeds (dev server 6.7.135, net10.0 host).

Proposal

In UnoToolsLocator (EnsureNugetPackage(..., tryInstall: false), src/Uno.UI.DevServer.Cli/Helpers/UnoToolsLocator.cs:95-101), when Uno.Sdk is missing from the cache:

  1. Check the configured sources (the NuGet.Config hierarchy of the solution) for the pinned version.
  2. Report one of two distinct outcomes:
    • not restored yet: "Uno.Sdk X is not restored yet. Run dotnet restore or build the solution."
    • unavailable: "Uno.Sdk X is not available on any configured NuGet source (nearest: Y). Update msbuild-sdks in global.json."
  3. Add a machine-readable code next to the message in the JSON payload (for example errorCodes: ["UnoSdkNotRestored" | "UnoSdkUnavailable"]). IDE extensions could then show a specific message and send a reason category in their telemetry, without parsing English text.

The same split applies to Uno.WinUI.DevServer not found in NuGet cache.

Why

Today the only signal is a generic "not found in cache". The extension and the in-app tooling end up showing generic messages ("could not be started", "server unreachable"), and the user spends time on IDE/workload troubleshooting (uno-check, reinstalling the extension) instead of fixing one line in global.json.

Activity

  1. added
    kind/enhancement
    area/hot-reload
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/hot-reloadkind/enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions