Skip to content

Deprecate the Blazor WebAssembly DevServer package#67862

Open
javiercn with Copilot wants to merge 9 commits into
mainfrom
copilot/deprecate-blazor-devserver-package
Open

Deprecate the Blazor WebAssembly DevServer package#67862
javiercn with Copilot wants to merge 9 commits into
mainfrom
copilot/deprecate-blazor-devserver-package

Conversation

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The standalone Blazor WebAssembly DevServer is being retired in favor of the newer Gateway host. This change makes that transition explicit by marking the package as deprecated, directing consumers to Gateway, and surfacing a clear startup warning so the migration path is visible where the package is actually used.

  • Package deprecation

    • Mark Microsoft.AspNetCore.Components.WebAssembly.DevServer as deprecated in package metadata and document Microsoft.AspNetCore.Components.Gateway as the replacement.
    • Update PACKAGE.md to present Gateway as the recommended hosting path for standalone Blazor WebAssembly apps.
  • Runtime guidance

    • Emit a deprecation warning from blazor-devserver at startup so developers see the migration guidance immediately.
    • Preserve the existing UseWebAssemblyDebugging() call with a targeted suppression comment so the DevServer project continues to build during the deprecation transition.

Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Copilot AI changed the title [WIP] Deprecate Microsoft.AspNetCore.Components.WebAssembly.DevServer package Deprecate the Blazor WebAssembly DevServer package Jul 16, 2026
Copilot AI requested a review from javiercn July 16, 2026 21:56
@javiercn
javiercn requested review from danroth27 and lewing July 16, 2026 23:26
@dotnet dotnet deleted a comment Jul 17, 2026
@javiercn
javiercn marked this pull request as ready for review July 17, 2026 08:42
@javiercn
javiercn requested a review from a team as a code owner July 17, 2026 08:42
Copilot AI review requested due to automatic review settings July 17, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the retirement of the standalone Blazor WebAssembly DevServer explicit by updating its package messaging and adding a runtime startup warning that directs developers to the newer Gateway host.

Changes:

  • Updated DevServer package description and PACKAGE.md to state the package is deprecated and point to Microsoft.AspNetCore.Components.Gateway.
  • Added a startup-time log warning in the DevServer host to surface migration guidance when the package is actually used.
  • Normalized the XML prolog line in CompatibilitySuppressions.xml (removing a leading BOM/indentation).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Framework/App.Runtime/src/CompatibilitySuppressions.xml Normalizes the XML header line formatting (removes BOM/indentation).
src/Components/WebAssembly/DevServer/src/Server/Startup.cs Logs a deprecation warning at startup; adds a logger dependency to Configure.
src/Components/WebAssembly/DevServer/src/PACKAGE.md Updates package documentation to recommend Gateway over DevServer.
src/Components/WebAssembly/DevServer/src/Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj Updates the NuGet description to clearly indicate deprecation and the replacement package.

Comment on lines +35 to +37
#pragma warning disable CS0618 // This middleware is deprecated as part of the DevServer deprecation path. The replacement is Microsoft.AspNetCore.Components.Gateway.
app.UseWebAssemblyDebugging();
#pragma warning restore CS0618
```

Make sure that the newly-added `<PackageReference />` in the `.csproj` file includes `PrivateAssets="all"`:
If you still need to reference the legacy package for compatibility reasons, make sure that the newly-added `<PackageReference />` in the `.csproj` file includes `PrivateAssets="all"`:

@oroztocil oroztocil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR and #67861 should decide what diagnostic to emit when obsoleting UseWebAssemblyDebugging and what warning to suppress src/Components/WebAssembly/DevServer/src/Server/Startup.cs.

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: spurious BOM change

@javiercn

Copy link
Copy Markdown
Member

@copilot fix the comments

Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the comments

Fixed in 1e555fc. Updated Startup.cs to suppress ASPDEPR011 (aligned with the UseWebAssemblyDebugging obsoletion), clarified the PACKAGE.md wording, and reverted the spurious BOM change in CompatibilitySuppressions.xml.

Copilot AI requested a review from javiercn July 17, 2026 14:03
The obsoletion of UseWebAssemblyDebugging and its required suppression are owned
by PR #67861. This PR only adds the DevServer deprecation startup warning; the
ASPDEPR011 pragma is dropped here to avoid duplicating the suppression.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9e4d745c-a233-409a-a399-2e2d750bc5c3

@danroth27 danroth27 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@javiercn
javiercn enabled auto-merge (squash) July 17, 2026 17:24
@javiercn

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits July 17, 2026 18:55
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
auto-merge was automatically disabled July 17, 2026 18:57

Head branch was pushed to by a user without write access

Copilot AI requested review from a team and wtgodbe as code owners July 17, 2026 18:57
Copilot AI requested a review from javiercn July 17, 2026 18:57
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Copilot AI requested a review from javiercn July 17, 2026 19:12
@javiercn
javiercn enabled auto-merge (squash) July 17, 2026 21:48
@javiercn

Copy link
Copy Markdown
Member

@copilot

Restored D:\a_work\1\s\src\Servers\Connections.Abstractions\src\Microsoft.AspNetCore.Connections.Abstractions.csproj (in 4 ms).
Restored D:\a_work\1\s\src\Servers\HttpSys\perf\Microbenchmarks\Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks.csproj (in 9 ms).
D:\a_work\1\s\src\Security\test\AuthSamples.FunctionalTests\AuthSamples.FunctionalTests.csproj : error NU1902: Warning As Error: Package 'AngleSharp' 0.9.9 has a known moderate severity vulnerability, GHSA-pgww-w46g-26qg [D:\a_work\1\s.dotnet\sdk\11.0.100-preview.6.26318.108\NuGet.targets]
Restored D:\a_work\1\s\src\Security\samples\StaticFilesAuth\StaticFilesAuth.csproj (in 37 ms).
Failed to restore D:\a_work\1\s\src\Security\test\AuthSamples.FunctionalTests\AuthSamples.FunctionalTests.csproj (in 60 ms).
Restored D:\a_work\1\s\src\Security\samples\PathSchemeSelection\PathSchemeSelection.csproj (in 72 ms).
Restored D:\a_work\1\s\src\Security\samples\Identity.ExternalClaims\Identity.ExternalClaims.csproj (in 73 ms).
Restored D:\a_work\1\s\src\Servers\IIS\IIS\test\IIS.NewHandler.FunctionalTests\IIS.NewHandler.FunctionalTests.csproj (in 4.09 sec).
Restored D:\a_work\1\s\src\Security\samples\CustomPolicyProvider\CustomPolicyProvider.csproj (in 49 ms).
Restored D:\a_work\1\s\src\Security\samples\CustomAuthorizationFailureResponse\CustomAuthorizationFailureResponse.csproj (in 48 ms).
Restored D:\a_work\1\s\src\Security\samples\DynamicSchemes\DynamicSchemes.csproj (in 62 ms).
Restored D:\a_work\1\s\src\Servers\IIS\IIS\test\testassets\InProcessNewShimWebSite\InProcessNewShimWebSite.csproj (in 4.53 sec).
Restored D:\a_work\1\s\src\Security\samples\Cookies\Cookies.csproj (in 48 ms).
Restored D:\a_work\1\s\src\Security\perf\Microbenchmarks\Microsoft.AspNetCore.Security.Microbenchmarks.csproj (in 11 ms).
Restored D:\a_work\1\s\src\Security\CookiePolicy\src\Microsoft.AspNetCore.CookiePolicy.csproj (in 5 ms).
Restored D:\a_work\1\s\src\Security\samples\ClaimsTransformation\ClaimsTransformation.csproj (in 40 ms).
Restored D:\a_work\1\s\src\Security\CookiePolicy\test\Microsoft.AspNetCore.CookiePolicy.Test.csproj (in 23 ms).
Restored D:\a_work\1\s\src\Security\CookiePolicy\samples\CookiePolicySample\CookiePolicySample.csproj (in 16 ms).
Restored D:\a_work\1\s\src\Security\Authorization\test\Microsoft.AspNetCore.Authorization.Test.csproj (in 26 ms).
1 of 586 projects are up-to-date for restore.

Build FAILED.

D:\a_work\1\s\src\Identity\test\Identity.Test\Microsoft.AspNetCore.Identity.Test.csproj : error NU1902: Warning As Error: Package 'AngleSharp' 0.9.9 has a known moderate severity vulnerability, GHSA-pgww-w46g-26qg [D:\a_work\1\s.dotnet\sdk\11.0.100-preview.6.26318.108\NuGet.targets]
D:\a_work\1\s\src\Identity\test\Identity.FunctionalTests\Microsoft.AspNetCore.Identity.FunctionalTests.csproj : error NU1902: Warning As Error: Package 'AngleSharp' 0.9.9 has a known moderate severity vulnerability, GHSA-pgww-w46g-26qg [D:\a_work\1\s.dotnet\sdk\11.0.100-preview.6.26318.108\NuGet.targets]
D:\a_work\1\s\src\Mvc\test\Mvc.FunctionalTests\Microsoft.AspNetCore.Mvc.FunctionalTests.csproj : error NU1902: Warning As Error: Package 'AngleSharp' 0.9.9 has a known moderate severity vulnerability, GHSA-pgww-w46g-26qg [D:\a_work\1\s.dotnet\sdk\11.0.100-preview.6.26318.108\NuGet.targets]
D:\a_work\1\s\src\Security\test\AuthSamples.FunctionalTests\AuthSamples.FunctionalTests.csproj : error NU1902: Warning As Error: Package 'AngleSharp' 0.9.9 has a known moderate severity vulnerability, GHSA-pgww-w46g-26qg [D:\a_work\1\s.dotnet\sdk\11.0.100-preview.6.26318.108\NuGet.targets]
0 Warning(s)
4 Error(s)

Time Elapsed 00:04:17.31
Build failed with exit code 1. Check errors above.
##[error]Cmd.exe exited with code '1'.
Finishing: Run restore.cmd

Rebase and fix the issue

Copilot AI and others added 2 commits July 18, 2026 11:17
…zor-devserver-package

Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
auto-merge was automatically disabled July 18, 2026 11:18

Head branch was pushed to by a user without write access

Copilot AI commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

Restored D:\a_work\1\s\src\Servers\Connections.Abstractions\src\Microsoft.AspNetCore.Connections.Abstractions.csproj (in 4 ms).
...

Done in a0663f6. The branch was behind main (it was reverting the Identity #67731 changes), so I brought it up to date with the latest main. The only content difference from main is now the three intended DevServer files (csproj description, PACKAGE.md, Startup.cs startup warning), aligned with the ASPDEPR011 suppression from the already-merged #67861. The DevServer project builds with 0 warnings/0 errors.

On the restore failure: the NU1902 error for AngleSharp 0.9.9 is a pre-existing, repo-wide NuGet audit advisory unrelated to this PR — eng/Versions.props pins AngleSharp to 0.9.9 on the latest main too, and the failing projects (Identity.Test, Identity.FunctionalTests, Mvc.FunctionalTests, AuthSamples.FunctionalTests) are unrelated to the DevServer changes. Bumping/suppressing that advisory would be a separate, repo-wide change outside the scope of this deprecation PR; let me know if you'd like me to take it on separately.

Copilot AI requested a review from javiercn July 18, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate the Microsoft.AspNetCore.Components.WebAssembly.DevServer package

5 participants