Repository navigation
Description
Current behavior
If an app's dotnet restore fails, uno-devserver start still exits 0 and starts the host. uno-devserver health then reports Status: Healthy. Neither command mentions the failed restore, so the developer gets a "healthy" Dev Server with no hint that the project can't be restored.
The failing restore here was a PackageReference with a Version in a project that uses central package management (the template's default), which gives error NU1008.
Logs
# Uno.Sdk 7.0.0-dev.89, Dev Server host 7.0.0-dev.2428, uno-devserver CLI 7.0.0-dev.2345
$ dotnet restore QaApp/QaApp.csproj
QaApp.csproj : error NU1008: The following PackageReference items cannot define a value for Version: Qa.Nonexistent.Package. Projects using Central Package Management must define a Version value on a PackageVersion item. ...
Failed to restore ...\QaApp\QaApp.csproj (in 82 ms).
exit=1
$ uno-devserver start
Uno Platform DevServer CLI - Version 7.0.0-dev.2345
Starting DevServer in direct mode: ...\Uno.UI.RemoteControl.Host.exe --httpPort 62607 --solution ...\QaApp.sln ...
exit=0 (1.2 s)
$ uno-devserver health
Status: Healthy
Connection: Unknown
Solution: ...\QaApp.sln
Resolution: CurrentDirectory
Selection: UserSelected
Tools: 0
Active Servers:
- PID: <pid> (Port 62607)
exit=0
Expected behavior
When the solution can't be restored, start should fail, or at least warn, and name the restore error (for example the NU code and the project). health should not report Healthy for that solution.
How to reproduce it (as minimally and precisely as possible)
dotnet new unoapp -n QaApp -preset blank -platforms desktop, thengit initin the folder.- In
QaApp/QaApp.csproj, before</Project>, add:<ItemGroup><PackageReference Include="Qa.Nonexistent.Package" Version="1.2.3" /></ItemGroup>
dotnet restore QaApp/QaApp.csprojfails with NU1008.- Run
uno-devserver start, thenuno-devserver health. startexits 0,healthsaysStatus: Healthy, and neither mentions the restore failure.
Reproduced in every run: 5 of 5 on 6.7.30, 4 of 4 on 7.0.0-dev.81 and 1 of 1 on 7.0.0-dev.89.
Workaround
Run dotnet restore or build the solution first, and read its errors.
Affected platforms
Desktop (Windows). The Dev Server CLI behaviour does not depend on the target.
Uno.Sdk version (and other relevant versions)
- Uno.Sdk / Uno.Templates 7.0.0-dev.89 (Dev Server host 7.0.0-dev.2428), 7.0.0-dev.81 (host 7.0.0-dev.2347) and 6.7.30 (host 6.7.135)
- uno-devserver CLI 7.0.0-dev.2345
- .NET SDK 10.0.401, Windows 11 Pro (26200)
IDE version
None (CLI only)
Anything else we need to know?
- Found by automated QA of the Uno SDK. The test expects either a failed
startor a non-Healthyhealth, plus a message naming the restore failure. - Only the NU1008 case was tested. Other restore failures (for example an unknown package id) were not.
- We did not check whether Hot Reload works for this solution afterwards.
Tools: 0is not related to the restore failure:healthreportsTools: 0for healthy projects too (a separate issue).- Related: [DevServer CLI] disco: tell a not-yet-restored Uno.Sdk apart from one that cannot be restored #25497, which asks
discoto tell an Uno.Sdk that isn't restored yet apart from one that can't be restored. - Suggested labels:
kind/bug,area/hot-reload.
Activity