Skip to content

MAUI Android Line Numbers & File Names Don't Appear in .NET 9 (But They Do in .NET 8) #4209

@lswdowcoombs

Description

@lswdowcoombs

Package

Sentry.Maui

.NET Flavor

.NET

.NET Version

9.0.203

OS

Android

OS Version

Android 13

Development Environment

Visual Studio v17.x

SDK Version

5.7.0

Self-Hosted Sentry Version

No response

Workload Versions

Installed Workload Id Manifest Version Installation Source
android 35.0.61/9.0.100 SDK 9.0.200, VS 17.13.35931.197
aspire 8.2.2/8.0.100 SDK 9.0.200, VS 17.13.35931.197
ios 18.4.9288/9.0.100 SDK 9.0.200, VS 17.13.35931.197
maccatalyst 18.4.9288/9.0.100 SDK 9.0.200, VS 17.13.35931.197
maui-windows 9.0.51/9.0.100 SDK 9.0.200, VS 17.13.35931.197
wasm-tools 9.0.4/9.0.100 SDK 9.0.200, VS 17.13.35931.197
wasm-tools-net8 9.0.4/9.0.100 SDK 9.0.200

UseSentry or SentrySdk.Init call

options.Dsn = "MY-SENTRY-DSN";

Steps to Reproduce

  1. Create a new .NET MAUI App Project in Visual Studio. Be sure to select .NET 9.
  2. Install Sentry.Maui version 5.7.0.
  3. Add the block of code for UseSentry() above to add the Dsn to startup options.
  4. In the sample app, open up MainPage.xaml.cs and throw an exception in the OnCounterClicked() method, for example, just so that can be logged to Sentry.
  5. In the sample app csproj file, add the following so that debug symbols are created and uploaded to Sentry automatically during the build. Replace SentryOrg, SentryProject, and SentryAuthToken accordingly:
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
  <SentryOrg>MY-SENTRY-ORG-NAME</SentryOrg>
  <SentryProject>MY-SENTRY-PROJECT-NAME</SentryProject>
  <SentryAuthToken>MY-SENTRY-AUTH-TOKEN</SentryAuthToken>
  <SentryUploadSymbols>true</SentryUploadSymbols>
</PropertyGroup>
  1. Build for Release, targeting Android.
  2. Verify that debug symbols are uploaded to Sentry for your project in the Outputs section of Visual Studio.
  3. Run the sample app without a debugger, targeting Android.
  4. Click/tap on the Click me button to increment the counter.
  5. Observe that the sample app should crash. Reopen the app to ensure that the crash details are sent up to Sentry.

Expected Result

An unhandled exception should be sent to Sentry and when viewing the details of the associated event, the stack trace should include line numbers and file names.

Actual Result

An unhandled exception is sent to Sentry, but when viewing the details of the associated event, the stack trace does not include line numbers and file names.

NOTE: If you repeat the above steps but use a project that targets .NET 8, line numbers and file names DO appear in the stack trace on Sentry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    Status

    Done

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions