Skip to content

iOS <EnableAssemblyILStripping>false</EnableAssemblyILStripping> not working: symbols missing #4482

Closed

Description

@giuseppenovielli

Package

Sentry.Maui

.NET Flavor

.NET

.NET Version

9.0.200

OS

iOS

OS Version

18.4

Development Environment

Visual Studio Code (MacOS)

SDK Version

5.14.1

Self-Hosted Sentry Version

No response

Workload Versions

maui-ios 9.0.0/9.0.100 SDK 9.0.200

UseSentry or SentrySdk.Init call

.UseSentry(options =>
            {
                // The DSN is the only required setting.
                options.Dsn = Constants.SentryConstants.DNS;

                // Set TracesSampleRate to 1.0 to capture 100% of transactions for tracing.
                // We recommend adjusting this value in production.
                options.TracesSampleRate = 1.0;
            })

Steps to Reproduce

  1. Create new .net maui application and sentry maui project
  2. into .csproj paste the follow property group e compile it from sentry project
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
		<Optimize>true</Optimize>
		
		<PublishTrimmed>true</PublishTrimmed>
		<TrimMode>partial</TrimMode>
		
		<DebugType>portable</DebugType>
		<DebugSymbols>true</DebugSymbols>

		<!-- Configure Sentry org and project -->
               <SentryOrg>example-org</SentryOrg>
               <SentryProject>example-project</SentryProject>

		<!-- Automatically creates a release when building your application. -->
		<SentryCreateRelease>true</SentryCreateRelease>

		<!-- Automatically associates commits with the release. -->
		<SentrySetCommits>true</SentrySetCommits>

		<!-- Optionally provide explicit flags to the set-commits command -->
		<SentrySetCommitOptions>--local</SentrySetCommitOptions>

		<!-- Sends symbols to Sentry, enabling symbolication of stack traces. -->
		<SentryUploadSymbols>true</SentryUploadSymbols>

		<!-- Sends sources to Sentry, enabling display of source context. -->
		<SentryUploadSources>true</SentryUploadSources>

		<!-- https://github.com/getsentry/sentry-dotnet/issues/4427 -->
		<EnableAssemblyILStripping>false</EnableAssemblyILStripping>

                 <!-- If you are targeting Android, sends proguard mapping file to Sentry. -->
		<SentryUploadAndroidProguardMapping>true</SentryUploadAndroidProguardMapping>

	</PropertyGroup>
  1. Into MainPage.xaml.cs add the follow code
protected override void OnAppearing()
{
          base.OnAppearing();

          throw new NotImplementedException('Method not implemented.');
}
  1. Set Compile mode to -> Release
  2. Compile and Run into an'IPhone device and launch app.
  3. The crash is visible to Sentry without the code context and symbols are missing.
Image

Expected Result

The crash is visible to Sentry but and code context is visible.

Actual Result

The crash is visible to Sentry without the code context and symbols are missing.

Activity

  1. added
    BugSomething isn't working
    .NETPull requests that update .net code
    on Aug 29, 2025
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Aug 29, 2025
  3. Flash0ver commented on Sep 2, 2025

    @Flash0ver
    Contributor

    I'll take a closer look and return with more details tomorrow

  4. jpnurmi commented on Sep 10, 2025

    @jpnurmi
    Collaborator

    EnableAssemblyILStripping=true

    Image

    EnableAssemblyILStripping=false

    Image
  5. jpnurmi commented on Sep 10, 2025

    @jpnurmi
    Collaborator

    sentry-cli has no problems parsing PDB 2.0 timestamp/age (?)

    $ dotnet build ... -p:EnableAssemblyILStripping=false
    [...]
    $ find . -name "Sentry.Samples.Maui.pdb" -exec echo {} \; -exec sentry-cli debug-files check {} \;
    ./obj/Release/net9.0-ios18.0/iossimulator-arm64/linked/Sentry.Samples.Maui.pdb
    Debug Info File Check
      Type: portablepdb debug companion
      Contained debug identifiers:
        > Debug ID: 377dba7a-cd71-feeb-1a59-8c8be12a8d68-43ec5c82
          Arch:     unknown
      Contained debug information:
        > debug, sources
      Usable: yes
    ./obj/Release/net9.0-ios18.0/iossimulator-arm64/Sentry.Samples.Maui.pdb
    Debug Info File Check
      Type: portablepdb debug companion
      Contained debug identifiers:
        > Debug ID: 377dba7a-cd71-feeb-1a59-8c8be12a8d68-43ec5c82
          Arch:     unknown
      Contained debug information:
        > debug, sources
      Usable: yes
    ./bin/Release/net9.0-ios18.0/iossimulator-arm64/Sentry.Samples.Maui.pdb
    Debug Info File Check
      Type: portablepdb debug companion
      Contained debug identifiers:
        > Debug ID: 377dba7a-cd71-feeb-1a59-8c8be12a8d68-43ec5c82
          Arch:     unknown
      Contained debug information:
        > debug, sources
      Usable: yes
  6. giuseppenovielli commented on Sep 10, 2025

    @giuseppenovielli
    Author

    Hi @jpnurmi,
    thanks, can you try to run app in Release mode on real device (iPhone)?
    The following screen, show more detail:
    DEBUG ID -> show complete id, without -1, but symbolication are missing....

    I don't undestand.

    Thanks!

    Image

    EnableAssemblyILStripping=true

    Image ### `EnableAssemblyILStripping=false` Image
  7. 12 remaining items

  8. jamescrosswell commented on Sep 14, 2025

    @jamescrosswell
    Collaborator

    Removing the bug label from this, as it appears to be a problem even when Sentry has not been added to the application (see final words in this comment).

    If it is a bug, then it's a bug in the MAUI/iOS SDK.

  9. giuseppenovielli commented on Sep 15, 2025

    @giuseppenovielli
    Author

    hi @jamescrosswell,
    the following screen is for Microsoft.Controls.dll that i think Sentry can retrieve from GitHub?

    Image

    One other thing to look at, while you're in the Debug Information Files settings is the built in repositories. For stuff like Microsoft libraries, you shouldn't need to upload these for every build you do (since they never change). We should be able to pull these from Microsoft's public symbol servers, but only if Microsoft is included in the built in repositories:

    Yes as you see from the following screen Built-in Repositories is configurated to retrieve symbols from Microsoft, Apple

    Image
  10. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 15, 2025
  11. jamescrosswell commented on Sep 15, 2025

    @jamescrosswell
    Collaborator

    OK so it's not available on any of the symbol servers that Sentry checked.

    @jpnurmi it looks like this one was in a "linked" directory:

    Image

    Any chance that fix you rolled out for MacCatalyst is related here?

    It is odd that we can't pull this from the Microsoft Symbol servers though.

  12. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Sep 15, 2025
  13. jpnurmi commented on Sep 15, 2025

    @jpnurmi
    Collaborator

    Possibly! We could try extending linked/$(AssemblyName).pdb to linked/*.pdb.

    That's actually why I ended up here earlier, because I saw "linked/" in a screenshot while browsing the Bug-labeled issues, but then got confused by the debug IDs.

  14. jamescrosswell commented on Sep 16, 2025

    @jamescrosswell
    Collaborator

    Possibly! We could try extending linked/$(AssemblyName).pdb to linked/*.pdb.

    Cool, thanks JP!

    @giuseppenovielli in the mean time, you could try manually uploading those missing PDB files using the sentry-cli tool. Under the hood, that's all the build target is doing when you add <SentryUploadSymbols>true</SentryUploadSymbols> and <SentryUploadSources>true</SentryUploadSources>. You can do this manually by running sentry-cli from the command line though (then you have a bit more control over what it uploads).

    There's a bunch of information about that in the Uploading Files section of the docs.

  15. jpnurmi commented on Sep 16, 2025

    @jpnurmi
    Collaborator

    P.S. If you don't have sentry-cli installed, you can run it straight from ~/.nuget/packages/sentry/5.14.1/tools/sentry-cli-Darwin-arm64 (or 5.15.0, x86_64).

  16. self-assigned this
    on Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions