Open
Description
Package
Sentry.Maui
.NET Flavor
MAUI
.NET Version
9.0.301
OS
Android
OS Version
Android API 34/35.
Development Environment
Visual Studio v17.x
SDK Version
6.10.0
Self-Hosted Sentry Version
No response
Workload Versions
Installed Workload Id Manifest Version Installation Source
---------------------------------------------------------------------
android 35.0.61/9.0.100 VS 17.14.36203.30
ios 18.4.9288/9.0.100 VS 17.14.36203.30
maccatalyst 18.4.9288/9.0.100 VS 17.14.36203.30
maui-windows 9.0.51/9.0.100 VS 17.14.36203.30
wasm-tools 9.0.6/9.0.100 VS 17.14.36203.30
Use `dotnet workload search` to find additional workloads to install.
UseSentry or SentrySdk.Init call
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseSentry(options => {
options.Dsn = "";
// Set SDK to debug mode, as this is a repro app.
options.Debug = true;
// Application release and distribution.
options.Release = $"maui-sentry-test@{AppInfo.VersionString}";
options.Distribution = AppInfo.BuildString;
// Set the environment based on build configuration.
#if DEBUG
options.Environment = "Development";
#else
options.Environment = "Production";
#endif
})
Steps to Reproduce
- Clone my repro project.
- Follow the README.md to configure the Sentry application and organisation slugs, and DSN.
- Build the app in
Debug
mode, and deploy to a device (i.e. Android). - Launch the app and click the
CommonService Exception
button. - Check your Sentry issues for the report, observe the behaviour from the "Expected" section.
- Build the app in
Release
mode, and deploy to a device. - Launch the app and click the
CommonService Exception
button. - Check your Sentry issues for the report, observe the behaviour from the "Actual Result" section.
This issue seems to be exhibited specigically when an exception occurs in a project separate to the main MAUI app, and the build is trimmed / optimised.
Expected Result
The stack trace will show line numbers and source context for all managed source:
Actual Result
In release mode, the stack trace only shows line numbers and source context for code within the "App" project:
I will note that I'm also seeing similar issues on iOS, but currently I can only deploy the test app to the simulator and it doesn't seem to be an issue there. Windows doesn't seem to show the same issue.
Metadata
Metadata
Assignees
Type
Projects
Status
No status
Status
No status