Repository navigation
[dotnet watch] Align mobile WebSocket authentication with WASM browser tools - #56722
Merged
Merged
Conversation
…r tools Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: befb0ae4-51ec-40ef-977f-aff77b16ac07
jonathanpeppers
requested review from
a team,
lbussell and
mthalman
as code owners
October 20, 2026 17:35
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Device-dependent key lookup and private-key file permissions need correction before approval.
1 open issue
What changed in this PR
Aligns mobile dotnet watch authentication with the build-owned key model used by browser tools.
Changes:
- Generates reusable keys and supplies the public key through runtime environment items.
- Verifies the provider’s secret echo before initialization.
- Shares key handling and adds authentication, build, and lifecycle tests.
| File | Description |
|---|---|
| test/TestAssets/TestProjects/WatchMobileApp/WatchMobileApp.csproj | Enables runtime environment support. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/EnsureHotReloadBrowserToolsKeyTest.cs | Tests key-write failures. |
| test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildANetCoreApp.cs | Tests key generation, reuse, and cleanup. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/WebSocketTransportTests.cs | Tests authentication and connection handling. |
| test/dotnet-watch.Tests/HotReload/MobileHotReloadTests.cs | Checks bootstrap environment isolation. |
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets | Generates and supplies mobile keys. |
| src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj | Includes shared key handling. |
| src/Tasks/Microsoft.NET.Build.Tasks/EnsureHotReloadWebSocketKey.cs | Adds the mobile key-generation task. |
| src/StaticWebAssetsSdk/Tasks/Microsoft.NET.Sdk.StaticWebAssets.Tasks.csproj | Includes shared key handling. |
| src/StaticWebAssetsSdk/Tasks/EnsureHotReloadBrowserToolsKey.cs | Delegates to the shared helper. |
| src/StaticWebAssetsSdk/AGENTS.md | Documents shared key handling. |
| src/Dotnet.Watch/Watch/AppModels/MobileAppModel.cs | Resolves mobile key output paths. |
| src/Dotnet.Watch/HotReloadClient/WebSocketClientTransport.cs | Loads build keys and echoes secrets. |
| src/Dotnet.Watch/HotReloadClient/Web/BrowserToolsBuildOutputs.cs | Supports mobile key filenames. |
| src/Dotnet.Watch/HotReloadAgent.Host/WebSocketTransport.cs | Verifies provider authentication. |
| src/Common/HotReloadKeyPair.cs | Centralizes key creation and validation. |
| documentation/specs/dotnet-watch-for-maui.md | Updates the mobile authentication contract. |
Review effort: Balanced
tmat
reviewed
Oct 29, 2026
tmat
reviewed
Oct 29, 2026
tmat
reviewed
Oct 29, 2026
tmat
reviewed
Oct 29, 2026
tmat
reviewed
Oct 29, 2026
tmat
reviewed
Oct 29, 2026
tmat
reviewed
Oct 29, 2026
tmat
requested changes
Oct 29, 2026
tmat
left a comment
Member
There was a problem hiding this comment.
Looks good, just a few minor things
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: befb0ae4-51ec-40ef-977f-aff77b16ac07
tmat
approved these changes
Oct 30, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: befb0ae4-51ec-40ef-977f-aff77b16ac07
tmat
approved these changes
Oct 30, 2026
Member
|
/backport to release/11.0.2xx |
Contributor
|
Started backporting to |
Contributor
|
@tmat backporting to git am output$ git cherry-pick a138b019f1929caac4086b03428ea4d57e9caa9f
CONFLICT (modify/delete): .github/memory/ARCHITECTURE.md deleted in HEAD and modified in a138b019f1 ([dotnet watch] Align mobile WebSocket authentication with WASM browser tools (#56722)). Version a138b019f1 ([dotnet watch] Align mobile WebSocket authentication with WASM browser tools (#56722)) of .github/memory/ARCHITECTURE.md left in tree.
Auto-merging src/Dotnet.Watch/AGENTS.md
Auto-merging src/Dotnet.Watch/HotReloadClient/Web/SharedSecretBuildOutputs.cs
Auto-merging src/Dotnet.Watch/Watch/AppModels/WebApplicationAppModel.cs
Auto-merging src/Dotnet.Watch/Watch/Browser/SharedSecretBuildOutputsExtensions.cs
CONFLICT (content): Merge conflict in src/Dotnet.Watch/Watch/Browser/SharedSecretBuildOutputsExtensions.cs
Auto-merging src/Dotnet.Watch/Watch/Build/BuildNames.cs
CONFLICT (content): Merge conflict in src/Dotnet.Watch/Watch/Build/BuildNames.cs
Auto-merging src/StaticWebAssetsSdk/AGENTS.md
Auto-merging src/StaticWebAssetsSdk/Targets/Microsoft.NET.Sdk.StaticWebAssets.HotReload.targets
Auto-merging src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj
Auto-merging test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildANetCoreApp.cs
Auto-merging test/Microsoft.NET.Sdk.StaticWebAssets.Tests/HotReloadBrowserToolsIntegrationTest.cs
error: could not apply a138b019f1... [dotnet watch] Align mobile WebSocket authentication with WASM browser tools (#56722)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: [dotnet watch] Align mobile WebSocket authentication with WASM browser tools
Applying: [dotnet watch] Address mobile authentication review feedback
Using index info to reconstruct a base tree...
A .github/memory/ARCHITECTURE.md
M src/Dotnet.Watch/AGENTS.md
M src/Dotnet.Watch/HotReloadClient/Web/BrowserToolsBuildOutputs.cs
M src/Dotnet.Watch/Watch/AppModels/MobileAppModel.cs
M src/Dotnet.Watch/Watch/Browser/BrowserToolsBuildOutputsExtensions.cs
M src/Dotnet.Watch/Watch/Build/BuildNames.cs
M src/StaticWebAssetsSdk/Targets/Microsoft.NET.Sdk.StaticWebAssets.HotReload.targets
M test/Microsoft.NET.Sdk.StaticWebAssets.Tests/HotReloadBrowserToolsIntegrationTest.cs
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): .github/memory/ARCHITECTURE.md deleted in HEAD and modified in [dotnet watch] Address mobile authentication review feedback. Version [dotnet watch] Address mobile authentication review feedback of .github/memory/ARCHITECTURE.md left in tree.
Auto-merging src/Dotnet.Watch/AGENTS.md
Auto-merging src/Dotnet.Watch/HotReloadClient/Web/SharedSecretBuildOutputs.cs
Auto-merging src/Dotnet.Watch/Watch/AppModels/MobileAppModel.cs
Auto-merging src/Dotnet.Watch/Watch/Browser/SharedSecretBuildOutputsExtensions.cs
CONFLICT (content): Merge conflict in src/Dotnet.Watch/Watch/Browser/SharedSecretBuildOutputsExtensions.cs
Auto-merging src/Dotnet.Watch/Watch/Build/BuildNames.cs
CONFLICT (content): Merge conflict in src/Dotnet.Watch/Watch/Build/BuildNames.cs
Auto-merging src/StaticWebAssetsSdk/Targets/Microsoft.NET.Sdk.StaticWebAssets.HotReload.targets
Auto-merging test/Microsoft.NET.Sdk.StaticWebAssets.Tests/HotReloadBrowserToolsIntegrationTest.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 [dotnet watch] Address mobile authentication review feedback
Error: The process '/usr/bin/git' failed with exit code 128 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Align mobile
dotnet watchWebSocket authentication with thebuild-owned key model introduced for WASM/browser tools in
#56118.
RuntimeEnvironmentVariableitems, rather than from watch.accepting Hot Reload updates.
Static Web Assets tasks.
Browser refresh server behavior and
dotnet run -esemantics remainunchanged.
Validation
regression tests.
Real-device execution was not performed.