Repository navigation
Description
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:
- Scan relative to the selected solution's directory rather than the workspace root — the
DevServer already knowsselectedSolutionPath. - Better: enumerate the solution's projects and read each one's
obj/project.assets.json. This
removes the depth heuristic entirely. - Failing that, scan recursively with a bounded depth, excluding
bin,objandnode_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.DevServerCLI 6.8.0-dev.105,Uno.WinUI.DevServerhost 6.8.0-dev.101Uno.UI.App.Mcp1.4.0-dev.1,Uno.Settings.DevServer1.14.0-dev.8- Source citations verified against
master@3a93f16b
Activity
fix(devserver): find add-ins via the solution's projects
fix(devserver): find add-ins via the solution's projects