Unable to enable sentry-native for non-AOT projects that include unmanaged C++ code
Package
Sentry
.NET Flavor
.NET
.NET Version
9.0
OS
Windows
OS Version
11
Development Environment
Visual Studio v18.x
SDK Version
6.0.0
Self-Hosted Sentry Version
sentry.stage.platform.jamflabs.com
Workload Versions
Workload version: 10.0.100-manifests.5fb86115
Installed Workload Id Manifest Version Installation Source
Use dotnet workload search to find additional workloads to install.
UseSentry or SentrySdk.Init call
SentrySdk.Init(o => { o.Dsn = "https://6829d42c28db9c7b117a1c0e3ba1f78e@sentry.stage.platform.jamflabs.com/5"; o.Debug = true; o.DiagnosticLevel = SentryLevel.Debug; });
Steps to Reproduce
Run SentrySdk.CauseCrash(Sentry.CrashType.Native);
Expected Result
Get a native crash
Actual Result
System complains it's not an AOT build. Why is this restricted to only Native AOT? Crashpad should work just fine with any executable, yet because the C# code itself isn't native I cannot capture crashes caused in unmanaged libraries included inside my C# managed executable. Is this intended behaviour? Am I forced to include sentry-native manually even though it should be tagged along the main C# SDK?
Is there a workaround I can use? Looking at your code you check the IsTrimmed and I don't want to or know how to bypass that check.
Thank you.
Thanks for opening this issue, @BorderKeeper. I also just noticed your message on Discord.
Coincidentally, just yesterday, I was looking into this myself as well, preparing a Demo that captures a native crash from a Native AOT compiled .NET application via the Sentry Desktop Crash Reporter.
We'll look into exposing External Crash Reporter, and maybe allow a "no-guard-rail" sentry-nativeopt-in. Let me get back to you on that.
Thanks a lot @Flash0ver we will go with Sentry-Native for C++ and Sentry C# SDK combo in Q1 next year and hope for good news here so we can simplify the design.