Move the Blazor WebAssembly sample off the deprecated DevServer

Đang mở Phù hợp với người mới
#5,906 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@jamescrosswell đang làm issue này rồi.

Từ ngày 30/11/2026.

  • #6049 của @jamescrosswell — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
67/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với project và launchSettings.json trong samples/Sentry.Samples.AspNetCore.Blazor.Wasm, sau đó so sánh với mẫu blazorwasm của .NET 11. Thay tham chiếu package DevServer bằng Gateway, bật StaticWebAssetSpaFallbackEnabled và xóa các mục inspectUri đã lỗi thời; kiểm tra xem profile IIS Express có hoạt động trên Windows không. Hoàn tất khi cả ba trang mẫu và các liên kết sâu đều hoạt động với Gateway và hành vi fallback đã được xác minh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

.NET Framework: Blazor

dotnet/aspnetcore#67857 deprecated Microsoft.AspNetCore.Components.WebAssembly.DevServer in .NET 11 and replaced it with Microsoft.AspNetCore.Components.Gateway. The 11.0.0 package says so on nuget.org, and DevServer logs this at startup:

Microsoft.AspNetCore.Components.WebAssembly.DevServer is deprecated and will be removed in a future release. Use Microsoft.AspNetCore.Components.Gateway instead.

samples/Sentry.Samples.AspNetCore.Blazor.Wasm still uses it. People copy our samples, so I'd like to move it to Gateway the same way the .NET 11 blazorwasm template does:

  • Swap the DevServer PackageReference for Gateway, keeping PrivateAssets="all".
  • Set StaticWebAssetSpaFallbackEnabled to true. Without it, Gateway returns 404 for every page, including /.
  • Drop the inspectUri entries from launchSettings.json. They only serve the legacy in-browser debugging that dotnet/aspnetcore#67858 obsoleted, and IDEs start the debug proxy themselves.

I've tried this locally on macOS. All three sample pages load, deep links work, and the SDK initializes the same way it does with DevServer. The published output doesn't change, because neither server gets deployed.

Two things to keep in mind:

  • The fallback property and the package swap need to land together. With the property set, DevServer finds two fallback routes and returns a 500 to any client that doesn't accept gzip. Browsers do accept it, so it's easy to miss.
  • The template no longer has an IIS Express profile, and I can't test ours on a Mac. I'd remove it too, unless someone on Windows wants to check that it still works with Gateway.

#5902 also bumps this sample's DevServer pin to 11.0.0, so whichever PR lands second needs a small rebase. The Playwright test app targets net10.0 with DevServer 10.0.0, which isn't deprecated, so it stays as it is.

Ngôn ngữ chính
C#
Star
775
Fork
262
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
118

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-dotnet

Tất cả issue của getsentry/sentry-dotnet

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.