Repository navigation
Description
Current behavior
A desktop app is started through uno-devserver app start and is connected. Then its Dev Server host is killed, and uno-devserver start brings up a new host for the same solution. The running app never rejoins the new host: for 90 s, uno-devserver app info answers "No connected app instance".
The restarted host listens on a different port from the one the app was built with:
| Uno.Sdk 7.0.0-dev.81 | Uno.Sdk 6.7.30 | |
|---|---|---|
First host --httpPort, port conveyed to the app's build |
49556 | 55992 |
Restarted host --httpPort |
57369 | 56629 |
The app keeps running after the host is killed, so the app itself is fine. But it has no way to find the new port, so Hot Reload and the App tools stay unavailable until the app is relaunched.
Logs
# Uno.Sdk 7.0.0-dev.81, Dev Server host 7.0.0-dev.2347, uno-devserver CLI 7.0.0-dev.2345
$ uno-devserver start
Starting DevServer in direct mode: ...\Uno.UI.RemoteControl.Host.exe --httpPort 49556 --solution ...\QaApp.sln ...
$ uno-devserver app info (while the app was starting)
No connected app instance. ... DevServer port 49556 was conveyed to the build. ...
$ uno-devserver app wait --ready
Hot Reload: Ready (server Ready, local Ready) (waited 5.6s)
$ uno-devserver list
Process ID: <host pid> (Uno.UI.RemoteControl.Host) Port: 49556
# the host process alone is killed (not the app); port 49556 closes; the app window stays open
$ uno-devserver start
Starting DevServer in direct mode: ...\Uno.UI.RemoteControl.Host.exe --httpPort 57369 --solution ...\QaApp.sln ...
$ uno-devserver app tools -> 15 tools
$ uno-devserver app info (every ~3 s for 90 s)
No connected app instance. No app has been started in this DevServer session - call uno_app_start first.
Expected behavior
The app should reconnect once a Dev Server for the same solution is available again. Then a developer whose host crashed, or who restarted it, doesn't have to relaunch the app to get Hot Reload back. Two ways this could work:
- a restart for the same solution reuses the port the running app was built with, when that port is free; or
- the app finds the new host some other way.
At minimum, the app or uno-devserver should say that the app is on a host that no longer exists.
How to reproduce it (as minimally and precisely as possible)
dotnet new unoapp -n QaApp -preset blank -platforms desktop, thengit initanddotnet build.uno-devserver start, thenuno-devserver app start --projectPath QaApp/QaApp.csproj --targetFramework net10.0-desktop, thenuno-devserver app wait --ready. Note the port in thestartoutput (--httpPort N) and the app's process id fromuno-devserver app info.uno-devserver listshows the host's process id. Kill only that process, for exampleStop-Process -Id <host pid>, leaving its children and the app. The app window stays open.uno-devserver startagain in the same folder. The output shows a different--httpPort. Wait untiluno-devserver app toolslists the tools.- Run
uno-devserver app infoevery few seconds for a minute or more: it always answers "No connected app instance".
Reproduced in 4 of 4 runs on each version below. The ports in the table come from the run whose logs were inspected, one run per version.
Workaround
Relaunch the app after restarting the Dev Server. Freshly launched apps connect normally, but this exact sequence was not tested.
Affected platforms
Desktop (Windows)
Uno.Sdk version (and other relevant versions)
- Uno.Sdk / Uno.Templates 7.0.0-dev.81 (Dev Server 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), target
net10.0-desktop
IDE version
None (CLI only)
Anything else we need to know?
- Found by automated QA of the Uno SDK (kill the Dev Server mid-session, restart it, and expect the app to reconnect).
- Not yet tested: whether the app reconnects when the new host happens to get the old port.
- Possibly related: [DevServer] Restart the devserver when exited #17756 ("[DevServer] Restart the devserver when exited", closed).
Activity