Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with what release my commits get attached to #4011

Open
Gekidoku opened this issue Feb 28, 2025 · 1 comment
Open

Issue with what release my commits get attached to #4011

Gekidoku opened this issue Feb 28, 2025 · 1 comment

Comments

@Gekidoku
Copy link

Gekidoku commented Feb 28, 2025

SDK version 5.2.0
Platform : .Net 9 MAUI,

With appcenter nearing termination i decided to look into switching to sentry.
Now I have some troubles getting my debug symbols to upload for release builds.
It uploads but it uses the wrong release name.

The context.
My AssemblyInfo.cs is empty.
My csprojc contains the following

 <PropertyGroup Condition="'$(TargetFramework)'=='net9.0-android'">
 <Version>myapp.MyVersion@v387+387</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'== 'Release'">
	<SentryOrg>myorg</SentryOrg>
	<SentryProject>myproject</SentryProject>
	<SentryCreateRelease>true</SentryCreateRelease>
	<SentrySetCommits>true</SentrySetCommits>
	<SentryUploadSymbols>true</SentryUploadSymbols>
	<SentryUploadSources>true</SentryUploadSources>
	<SentryUploadAndroidProguardMapping>true</SentryUploadAndroidProguardMapping>
</PropertyGroup>


and I have this in my MauiProgram.cs

        .UseSentry(options =>
        {
            options.Dsn = "mysupersecretDSN";
            options.IncludeTextInBreadcrumbs = true;
            options.IncludeTitleInBreadcrumbs = true;
            options.AttachScreenshot = true;
#if ANDROID
            options.Release = "myapp.MyVersion@v387+387";
            options.Debug = true;
#endif


        });

However in my buildlog I still see this.
1>Getting Sentry Release...
1>Sentry Release: [email protected]
1>Creating Sentry Release: [email protected]
1>Created release '[email protected]'
1>Setting Sentry commits.

I build just using visual studio's start without debugging while set to release.

But the release with the name myapp.MyVersion@v387+387 does get created. its just that the commit goes to the wrong release

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 28, 2025
@Gekidoku Gekidoku changed the title Issue with release name. Issue with what release my commits get attached to Feb 28, 2025
@jamescrosswell
Copy link
Collaborator

Hi @Gekidoku ,

I think AssemblyInfo.cs isn't used when building android apps.

When creating releases, Sentry checks:

  1. The SENTRY_RELEASE environment variable, if set
  2. The AssemblyInformationalVersionAttribute, if defined
  3. The version of the entry assembly for the project
  4. The version suggested by running sentry-cli releases propose-version

Everything except for reading that value from the environment variable happens here at build time... For debugging purposes then, you could just copy/paste that snippet from our MS Build task into your MAUI app to verify that the settings you're using for your MAUI app are correctly setting the release via one of those means.

One way to set the AssemblyInformationalVersionAttribute value a MAUI Android application is :

    <VersionPrefix>2.3.4</VersionPrefix>
    <VersionSuffix>beta+567</VersionSuffix>

This is what we do in the Sentry.Samples.Maui app (although this might not be obvious, as it's done in a Directory.Build.props file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

No branches or pull requests

2 participants