Skip to content

DevServer add-in discovery misses project.assets.json when projects sit more than one level below the workspace root #24311

Description

@dr1rrb

Summary

ProjectAssetsParser.FindProjectAssetsFiles only scans two levels — the workspace root and its
immediate subdirectories. For any repository whose projects live under src/<Project>/, the
restored assets are three levels down and are never found. Add-in discovery then silently resolves
package versions from the Uno SDK defaults only, and Uno.UI.App.Mcp is never resolved, which
disables the DevServer MCP endpoint entirely.

Repro shape

<root>/
  global.json
  src/
    MyApp.slnx
    MyApp/
      MyApp.csproj                  <- head, OutputType Exe, Optimize false
      obj/project.assets.json       <- contains Uno.UI.App.Mcp

Start the DevServer MCP bridge (uno.devserver --mcp-app) anywhere in that repo and select
src/MyApp.slnx.

Observed

The host process is launched without the MCP add-in:

Uno.UI.RemoteControl.Host.dll --httpPort NNNNN --solution .../src/MyApp.slnx \
  --addins .../uno.settings.devserver/1.13.0-dev.7/tools/devserver/Uno.Settings.DevServer.dll

1.13.0-dev.7 is the Uno SDK default, not the version the project actually restored
(1.14.0-dev.8), and Uno.UI.App.Mcp is absent altogether — even though the project references it
(UnoAppMcpVersion = 1.4.0-dev.1, present in obj/project.assets.json for every target
framework).

GET /mcp on the host returns 404 and uno_health reports toolCount: 0.

Cause

UnoToolsLocator.cs:56 sets the scan root to the workspace root:

workDirectory = workspaceResolution.EffectiveWorkspaceDirectory!;

and UnoToolsLocator.cs:202 passes it straight to the scan:

var projectAssetsFiles = ProjectAssetsParser.FindProjectAssetsFiles(workDirectory, _logger);

ProjectAssetsParser.FindProjectAssetsFiles checks exactly two locations:

  • {startDirectory}/obj/project.assets.json
  • {startDirectory}/{immediate subdir}/obj/project.assets.json

With the layout above, the head's assets are at {root}/src/MyApp/obj/project.assets.json — one
level too deep. The scan returns nothing, TargetsAddInResolver.BuildMergedPackageList receives an
empty list, and only the SDK's packages.json contributes package versions.

Downstream chain: no Uno.UI.App.Mcp in --addins → the add-in never registers
AddMcpServer().WithHttpTransport() → MapMcp("/mcp") throws in
Uno.UI.RemoteControl.Host/Startup.cs → the exception is swallowed and the MCP feature is disabled.

Verification

Symlinking the head one level up so the assets become reachable at
{root}/<Project>/obj/project.assets.json is enough to fix it. The host is then launched with:

--addins .../uno.ui.app.mcp/1.4.0-dev.1/tools/devserver/Uno.UI.App.Mcp.Server.dll;
         .../uno.settings.devserver/1.14.0-dev.8/tools/devserver/Uno.Settings.DevServer.dll

GET /mcp then returns 400 instead of 404 (endpoint mapped), the initialize handshake succeeds,
and all uno_app_* tools become available. Nothing else about the repository changed.

No configuration works around this: neither starting the process in the solution directory nor
passing --solution-dir moves EffectiveWorkspaceDirectory away from the repository root (filed
separately).

Suggested fix

In order of preference:

  1. Scan relative to the selected solution's directory rather than the workspace root — the
    DevServer already knows selectedSolutionPath.
  2. Better: enumerate the solution's projects and read each one's obj/project.assets.json. This
    removes the depth heuristic entirely.
  3. Failing that, scan recursively with a bounded depth, excluding bin, obj and node_modules.

A regression test over a {root}/src/{app}/obj/project.assets.json layout would cover it — this is
a very common repository shape.

Environment

  • .NET SDK 10.0.111, Linux x64
  • Uno SDK 6.8.0-dev.101
  • Uno.DevServer CLI 6.8.0-dev.105, Uno.WinUI.DevServer host 6.8.0-dev.101
  • Uno.UI.App.Mcp 1.4.0-dev.1, Uno.Settings.DevServer 1.14.0-dev.8
  • Source citations verified against master @ 3a93f16b

Activity

  1. added a commit that references this issue on Oct 27, 2026
    5f89f3c
  2. added a commit that references this issue on Nov 3, 2026
    b7c99ec
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions