sentry-dotnet
sentry-dotnet copied to clipboard
Blazor publish fails when using profiling
Package
Sentry
.NET Flavor
.NET
.NET Version
8.0.0
OS
Browser
SDK Version
4.9.0
Self-Hosted Sentry Version
No response
Steps to Reproduce
Add Profiling to a Sentry application and publish it with AOT enabled
Expected Result
Build suceeds
Actual Result
Build fails with an error during precompiling
21:39:54 [ERR] /usr/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.7/Sdk/WasmApp.Native.targets(686,5): error : Precompiling failed for /builds/xxxxxxxxx/xxxxxxxxx/src/Web/Web.Blazor/obj/Release/linked/Microsoft.Diagnostics.Tracing.TraceEvent.dll with exit code 1. [/builds/xxxxxxxxx/xxxxxxxxx/src/Web/Web.Blazor/Web.Blazor.csproj]
21:39:54 [ERR] /usr/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.7/Sdk/WasmApp.Native.targets(686,5): error : Mono Ahead of Time compiler - compiling assembly /builds/xxxxxxxxx/xxxxxxxxx/src/Web/Web.Blazor/obj/Release/linked/Microsoft.Diagnostics.Tracing.TraceEvent.dll [/builds/xxxxxxxxx/xxxxxxxxx/src/Web/Web.Blazor/Web.Blazor.csproj]
21:39:54 [ERR] /usr/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.7/Sdk/WasmApp.Native.targets(686,5): error : Failed to load method 0x600001a from '/builds/xxxxxxxxx/xxxxxxxxx/src/Web/Web.Blazor/obj/Release/linked/Microsoft.Diagnostics.Tracing.TraceEvent.dll' due to Could not load file or assembly 'Dia2Lib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.. [/builds/xxxxxxxxx/xxxxxxxxx/src/Web/Web.Blazor/Web.Blazor.csproj]
21:39:54 [ERR] /usr/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.7/Sdk/WasmApp.Native.targets(686,5): error : Run with MONO_LOG_LEVEL=debug for more information. [/builds/xxxxxxxxx/xxxxxxxxx/src/Web/Web.Blazor/Web.Blazor.csproj]
21:39:54 [ERR] /usr/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.7/Sdk/WasmApp.Native.targets(686,5): error : AOT of image /builds/xxxxxxxxx/xxxxxxxxx/src/Web/Web.Blazor/obj/Release/linked/Microsoft.Diagnostics.Tracing.TraceEvent.dll failed. [/builds/xxxxxxxxx/xxxxxxxxx/src/Web/Web.Blazor/Web.Blazor.csproj]
Oof, I don't think we ever tested profiling in conjunction with Blazor. That's something we might be able to cover via our samples tho. Thanks for reporting this!
One small note regarding profiling and Blazor: Blazor runs single threaded so if profiling needs another thread for some background jobs this will not be supported until .NET 9 ships.
One small note regarding profiling and Blazor: Blazor runs single threaded so if profiling needs another thread for some background jobs this will not be supported until .NET 9 ships.
@klemmchr I take it you're talking about Blazor WebAssembly here, so you're wanting to profile WebAssembly UI applications running in the browser? A lot of the profiling code is unmanaged code (basically C) so I'm not sure how well this will translate to WebAssembly.
Oh yeah then this is another hurdle for profiling in Blazor WebAssembly.
looks like we'll have .NET profiling on wasm too from .NET 10
- https://github.com/dotnet/runtime/issues/76316#issuecomment-2662463594
I've made another issue regarding Blazor WebAssembly profiling support:
- https://github.com/getsentry/sentry-dotnet/issues/4506