fix: disallow building Blazor WASM with Profiling#4512
Merged
jamescrosswell merged 3 commits intomainfrom Sep 11, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4512 +/- ##
=======================================
Coverage 73.43% 73.43%
=======================================
Files 479 479
Lines 17506 17506
Branches 3480 3480
=======================================
Hits 12856 12856
Misses 3772 3772
Partials 878 878 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jamescrosswell
approved these changes
Sep 11, 2025
Collaborator
jamescrosswell
left a comment
There was a problem hiding this comment.
LGTM - thanks @alexsohn1126 !
Contributor
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- disallow building Blazor WASM with Profiling ([#4512](https://github.com/getsentry/sentry-dotnet/pull/4512))If none of the above apply, you can opt out of this check by adding |
This was referenced Sep 22, 2025
This was referenced Oct 6, 2025
This was referenced Oct 15, 2025
This was referenced Oct 28, 2025
This was referenced Nov 18, 2025
This was referenced Dec 8, 2025
This was referenced Dec 15, 2025
This was referenced Jan 18, 2026
This was referenced Mar 7, 2026
Closed
This was referenced Mar 30, 2026
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.
Fixes #3523:
Problem
We do not support profiling in Blazor WebAssembly apps. However, it was possible to pass initialize a Blazor WASM app with profiling, which led to undefined behaviours.
The issue above reported failing to publish Blazor WASM app when profiling is enabled. I was not able to replicate that, both in the current version of SDK, and also the version that the issue reporter was using (v4.9.0).
I did find that adding profiling in Blazor WASM led to errors in the browser:
Fix
Notify the user if they are using
Sentry.Profilingin a Blazor WebAssembly project. If so, we throw an error pre-build, with a more descriptive message:This was possible because Blazor WebAssembly apps have
UsingMicrosoftNETSdkBlazorWebAssemblyMSBuild property. See:Testing Instructions
Sentry.Profilingpackage in a Blazor WebAssembly.csproj:<PackageReference Include="Sentry.Profiling" Version="5.15.1"/>csprojfile (before</Project>), importSentry.Profiling.targets. In the case ofsamples/Sentry.Samples.AspNetCore.Blazor.Wasm.csproj:<Import Project="..\..\src\Sentry.Profiling\buildTransitive\Sentry.Profiling.targets" />See also: