From 85270e2d2791af6e0076f88eddbb42690bcf7cf6 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 15 Oct 2026 12:59:21 +1300 Subject: [PATCH] fix: run Sentry CLI targets after Native AOT optimized publish From RC 2 the .NET 11 SDK publishes Native AOT apps without running Build: UseOptimizedPublish defaults to true when PublishAot is set, and Publish depends on _PublishOptimizedBuildAlternative, which runs only Compile and the publish targets (dotnet/sdk#54515). CheckSentryCLI, which every upload and release target depends on, hooked AfterTargets="Build", so symbol upload and release creation silently stopped. This is decided by the SDK, not the TFM, so net8.0-net10.0 apps are affected too. CheckSentryCLI, _CreateSentryRelease and _SentrySetCommits now also run after _PublishOptimizedBuildAlternative. Ported by hand from the version7 fix: _GetSentryRelease already runs after PrepareSentryCLI on main, so it needs no change. Fixes #5727 Co-Authored-By: Claude Opus 5.5 --- src/Sentry/buildTransitive/Sentry.targets | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Sentry/buildTransitive/Sentry.targets b/src/Sentry/buildTransitive/Sentry.targets index 731598b5e8..f6de3ae816 100644 --- a/src/Sentry/buildTransitive/Sentry.targets +++ b/src/Sentry/buildTransitive/Sentry.targets @@ -21,6 +21,8 @@ $([System.Guid]::NewGuid()) true false + + <_SentryAfterBuildTargets>Build;_PublishOptimizedBuildAlternative - + false @@ -398,7 +400,7 @@ - -