Repository navigation
Description
What would you like to be added? 💡
Move the DevServer's hot-reload emit from reflection over Roslyn internals to Roslyn's supported API, Microsoft.CodeAnalysis.ExternalAccess.HotReload.HotReloadService, once that assembly ships in a released package.
Today Uno.HotReload (WatchHotReloadService) creates Roslyn's internal ExternalAccess.UnitTesting.Api.UnitTestingHotReloadService. Since #24085 it no longer calls that wrapper's emit, because the wrapper commits the Edit-and-Continue baseline whenever the status is Ready, and Roslyn 5.x answers Ready for a rejected rude edit too (#25378). Instead it reflects into the wrapper's private _encService / _sessionId fields and drives the engine directly (EmitSolutionUpdateAsync, CommitSolutionUpdate, DiscardSolutionUpdate, and the members of EmitSolutionUpdateResults).
ExternalAccess.HotReload.HotReloadService is the API built for this. It returns the updates together with the projects to rebuild/restart, and leaves commit/discard to the caller, which is the contract #24085 rebuilds by hand.
Why is this needed? 🤔
The reflection depends on about 20 private Roslyn members. A Roslyn bump that renames or reshapes any of them makes every hot-reload session fail at startup. The failure is explicit, naming the member, but hot reload is down until the shim is patched. A supported API removes that risk and the reflection code (WatchHotReloadService.Emit.cs).
Where the assembly stands today (checked 2026-10-14):
- nuget.org: not published (
Microsoft.CodeAnalysis.ExternalAccess.HotReloadreturns 404). - dnceng
dotnet-toolsfeed: prerelease builds only (5.13.0-1.*). - .NET SDK: bundled privately inside
dotnet-watch(sdk/10.0.400/DotnetTools/dotnet-watch/.../Microsoft.CodeAnalysis.ExternalAccess.HotReload.dll). Microsoft.CodeAnalysis.Features5.6.0, the line the DevServer embeds, grants itInternalsVisibleTobut does not contain it.
For which platforms 📱💻🖥️
All platforms 🌍
Anything else we need to know? 💬
- Trigger: a stable
Microsoft.CodeAnalysis.ExternalAccess.HotReloadon nuget.org, at a version compatible with the Roslyn line pinned insrc/Uno.DevServer.Roslyn.props. - The migration should keep the commit policy from fix(hr): never commit an EnC baseline for an update that was not applied #24085: commit only when deltas are handed out, and discard otherwise. Ideally the commit moves after the deltas are applied (today it happens before
IHotReloadHandler.OnHotReloadAsync). HotReloadEmitResult(internal) already carries what that API returns, so consumers ofIWatchHotReloadServiceshould not need to change.
Activity