Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ runs:
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf libc6:armhf

# See https://github.com/actions/runner-images/blob/main/images/macos/macos-26-Readme.md#xcode
# See https://github.com/actions/runner-images/blob/main/images/macos/xcode-27-arm64-Readme.md#xcode
# Also https://github.com/dotnet/macios/issues/21762#issuecomment-3424033859 (don't reference symlinks)
- name: Pin the Xcode Version
if: runner.os == 'macOS'
shell: bash
run: sudo xcode-select --switch /Applications/Xcode_26.6.app
run: sudo xcode-select --switch /Applications/Xcode_27.app

# Java 21 is needed by .NET Android
- name: Install Java 21
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
volumes:
- /tmp/node20:/__e/node20
- /tmp/node24:/__e/node24
- os: macos-26 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
- os: xcode-27 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
rid: macos # universal (osx-arm64 + osx-x64)
- os: windows-2025-vs2026
rid: win-x64
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
- /tmp/node20:/__e/node20
- /tmp/node24:/__e/node24
- /var/run/docker.sock:/var/run/docker.sock
- os: macos-26 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
- os: xcode-27 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
rid: macos # universal (osx-arm64 + osx-x64)
slnf: Sentry-CI-Build-macOS.slnf
# .NET 10+ Native AOT requires VS 2026 (https://github.com/dotnet/runtime/issues/133835)
Expand Down Expand Up @@ -421,7 +421,7 @@ jobs:
trim-analysis:
needs: build-sentry-native
name: Trim analysis
runs-on: macos-26
runs-on: xcode-27

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/device-tests-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ on:

jobs:
ios-tests:
runs-on: macos-26
runs-on: xcode-27
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Format Code
# Run on 'macos' because Linux is missing the `ios` workload: https://github.com/dotnet/runtime/issues/85505
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
runs-on: macos-26
runs-on: xcode-27
steps:
# PR head, not the merge ref: the submodule working trees must match the branch we commit to
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
matrix:
include:
# macOS covers all non-Windows TFMs (net8.0 - net11.0, netstandard, iOS, MacCatalyst, Android)
- os: macos-26
- os: xcode-27
rid: macos
slnf: Sentry-CI-Build-macOS.slnf
# Windows is required to produce the .NET Framework (net48 / Net4_8) verified files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vulnerabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
list-vulnerable-packages:
name: List vulnerable packages
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
runs-on: macos-26
runs-on: xcode-27

steps:
- name: Checkout
Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ they cost nothing, and the next LTS transition brings some of those versions bac
| Test hosts fail to start: `You must install or update .NET` | `.github/actions/environment/action.yml` | Once `global.json` pins the new SDK, the previous runtime no longer comes with it, but we still target and test it. Add `{N-1}.0.x` to `dotnet-version`. Most runners have it preinstalled, so this usually only shows up on the Alpine containers. |
| `XA4216` deployment target not supported / `SupportedOSPlatformVersion` lower than minimum | `Directory.Build.props` **and** `Directory.Build.targets` | Platform minimums rise with each release. Condition the new value on the new TFM so existing consumers aren't affected — see the Android and MacCatalyst entries there. These are user-facing breaking changes; add them to the PR's `### Changelog Entry`. |
| `NETSDK1094` / `NETSDK1096` optimizing assemblies for performance failed | app `.csproj`s with an Android TFM | ReadyToRun can't target Android at all (`crossgen2`: `Target OS 'android' is not supported`), but the SDK may enable it by default. Set `PublishReadyToRun=false` on the affected app. |
| iOS app builds fail with `requires Xcode X, the current version is Y` | `integration-test/*.ps1`, device test apps | Each .NET for iOS SDK pack pins an **exact** Xcode version, so only one iOS TFM is buildable on a given machine. Build the TFM matching the Xcode that CI pins, and don't try to cover two. Libraries skip this check, which is why only app builds are affected. |
| iOS app builds fail with `requires Xcode X, the current version is Y` | `integration-test/*.ps1`, device test apps | Each .NET for iOS SDK pack pins an **exact** Xcode version, so only one iOS TFM is buildable on a given machine. Build the TFM matching the Xcode that CI pins, and don't try to cover two. Libraries skip this check, which is why only app builds are affected. When an RC needs an Xcode the `macos-*` images don't carry yet, move the macOS jobs to the matching preview image (.NET 11 RC 2 needed `xcode-27`) and update the `Pin the Xcode Version` step in `.github/actions/environment/action.yml`. |
| `NETSDK1140` X is not a valid TargetPlatformVersion for ios | `Directory.Build.props`, `test/Sentry.Maui.Device.TestApp`, `integration-test/common.ps1`, `integration-test/ios.Tests.ps1`, `integration-test/maui-device`, `scripts/device-test-utils.ps1` | An Apple pack accepts only its own platform version, so when an RC moves to a new Xcode (.NET 11 RC 2 went from 26.5 to 27.0) the old TFM stops resolving. The version is spelled out in every one of those places; update them together. |
| iOS device tests fail with XHarness exit code 80 (`APP_CRASH`), but the app never launched | `scripts/device-test-utils.ps1` | The `mlaunch` bundled with XHarness doesn't support the new Xcode. Bump the pinned XHarness. `Install-XHarness` doesn't install if any `xharness` is already on the `PATH`, so update your local one too. |
| Symbol upload silently stops, or sends the wrong files | `src/Sentry/buildTransitive/Sentry.targets` | We depend on SDK target names and intermediate directories, and these change between previews without errors. In .NET 11, `_CopyAotSymbols` went away in preview 7, `linked` became `postprocessed-assemblies` in RC 1, and in RC 2 Native AOT publish stopped running `Build` and both directories were written. `cli.Tests.ps1` is what catches it. Compare which targets run and which directories get written under the old and new SDKs. |
| Verify snapshots missing for the new TFM | `test/**/*.verified.txt` | Delete the snapshots for dropped TFMs. New ones for macOS-covered TFMs regenerate on a local test run. The `.Windows.` and `Net4_8` ones can only be produced on Windows — take them from the `<rid>-verify-test-results` CI artifact rather than hand-writing them; they are UTF-8 with BOM and no trailing newline. |
| `CS0400` The type or namespace name '...' could not be found | `src/Sentry.Bindings.Android/Transforms/` | Newer Android binding generators stopped pruning methods whose parameter/return types are unbound, so a `Bind="false"` Java dependency leaks an unresolvable type into the generated C#. `remove-node` the offending member. Because the older generator already pruned it, the same entry warns `BG8A00` there - put net-N-only entries in their own transform file and `TransformFile Remove` it for older TFMs, since the SDK auto-globs `Transforms/**/*.xml` into every TFM. |
| `CsWinRT1032` Collection expressions targeting non mutable interface type | any `-windows` TFM | A newer CsWinRT rejects a collection expression whose target is a non-mutable interface (`IEnumerable<T>`), because the synthesised type isn't trim/AOT-safe for WinRT. Cast the expression to a concrete array rather than changing the public signature it's passed to. |
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
<CurrentTfms>net8.0;net9.0;net10.0;net11.0</CurrentTfms>
<LatestAndroidTfm>net11.0-android37.0</LatestAndroidTfm>
<PreviousAndroidTfm>net10.0-android36.0</PreviousAndroidTfm>
<LatestIosTfm>net11.0-ios26.5</LatestIosTfm>
<LatestIosTfm>net11.0-ios27.0</LatestIosTfm>
<PreviousIosTfm>net10.0-ios26</PreviousIosTfm>
<LatestMacCatalystTfm>net11.0-maccatalyst26.5</LatestMacCatalystTfm>
<LatestMacCatalystTfm>net11.0-maccatalyst27.0</LatestMacCatalystTfm>
<PreviousMacCatalystTfm>net10.0-maccatalyst26</PreviousMacCatalystTfm>
<LatestWindowsTfm>net11.0-windows10.0.19041.0</LatestWindowsTfm>
<PreviousWindowsTfm>net10.0-windows10.0.19041.0</PreviousWindowsTfm>
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "11.0.100-rc.1.26425.128",
"workloadVersion": "11.0.100-rc.1.26458.5",
"version": "11.0.100-rc.2.26504.105",
"workloadVersion": "11.0.100-rc.2.26509.2",
"rollForward": "disable",
"allowPrerelease": false
}
Expand Down
2 changes: 2 additions & 0 deletions integration-test/cli.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ Describe 'MAUI (<framework>)' -ForEach @(
'Microsoft.Maui.pdb',
'SentryObjC'
)
# Names alone can't tell the trimmer's linked/ PDBs from the postprocessed ones that actually ship
$result.ScriptOutput | Should -Not -AnyElementMatch 'linked/\*\.pdb'
# The specific number of debug information files seems to change with different SDK - so we just check for non-zero
$nonZeroNumberRegex = '[1-9][0-9]*';
$result.ScriptOutput | Should -AnyElementMatch "Found $nonZeroNumberRegex debug information files \($nonZeroNumberRegex with embedded sources\)"
Expand Down
2 changes: 1 addition & 1 deletion integration-test/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BeforeAll {
{
switch ($framework) {
'net10.0' { return '26' } # matches PreviousIosTfm / PreviousMacCatalystTfm
'net11.0' { return '26.5' } # matches LatestIosTfm / LatestMacCatalystTfm
'net11.0' { return '27.0' } # matches LatestIosTfm / LatestMacCatalystTfm
default { throw "Unsupported framework '$framework' for iOS target platform version." }
}
}
Expand Down
5 changes: 3 additions & 2 deletions integration-test/ios.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Describe 'iOS app (<tfm>, <configuration>, <runtime>)' -ForEach @(
# UseMonoRuntime property was removed. Mono on iOS is therefore covered only by net10.0, which
# this job can't build alongside net11.0 because of the Xcode pinning noted above. See
# https://devblogs.microsoft.com/dotnet/coreclr-progress-and-mono-timeline-dotnet-maui/
@{ tfm = "net11.0-ios26.5"; configuration = "Release"; runtime = "coreclr" }
@{ tfm = "net11.0-ios26.5"; configuration = "Debug"; runtime = "coreclr" }
@{ tfm = "net11.0-ios27.0"; configuration = "Release"; runtime = "coreclr" }
@{ tfm = "net11.0-ios27.0"; configuration = "Debug"; runtime = "coreclr" }
) -Skip:(-not $script:simulator) {
BeforeAll {
. $PSScriptRoot/../scripts/device-test-utils.ps1
Expand Down Expand Up @@ -126,6 +126,7 @@ Describe 'iOS app (<tfm>, <configuration>, <runtime>)' -ForEach @(
$result.HasErrors() | Should -BeFalse
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.ApplicationException`""
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"nsexception`""
$result.Envelopes() | Should -AnyElementMatch "`"in_foreground`":true"
$result.Envelopes() | Should -HaveCount 1
}

Expand Down
2 changes: 1 addition & 1 deletion integration-test/maui-device/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static void OnActivated()

if (HasTestArg("OnActivated"))
{
throw new ApplicationException("This exception was thrown deliberately from AppDelegate.OnActivated.");
throw new ApplicationException("This exception was thrown deliberately from SceneDelegate.OnActivated.");
}
}

Expand Down
7 changes: 0 additions & 7 deletions integration-test/maui-device/Platforms/iOS/AppDelegate.cs

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers wondering why this has been removed: once the app adopts scenes, UIKit stops calling OnActivated. The test hook has moved to SceneDelegate.OnActivated(UIScene)

Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
using Foundation;
using UIKit;

namespace Sentry.Maui.Device.IntegrationTestApp;

[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();

public override void OnActivated(UIApplication application)
{
base.OnActivated(application);
App.OnActivated();
}
}
17 changes: 17 additions & 0 deletions integration-test/maui-device/Platforms/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>__MAUI_DEFAULT_SCENE_CONFIGURATION__</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
Expand Down
14 changes: 14 additions & 0 deletions integration-test/maui-device/Platforms/iOS/SceneDelegate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Foundation;
using UIKit;

namespace Sentry.Maui.Device.IntegrationTestApp;

[Register("SceneDelegate")]
public class SceneDelegate : MauiUISceneDelegate
{
public override void OnActivated(UIScene scene)
{
base.OnActivated(scene);
App.OnActivated();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- Pin target iOS version so that our tests don't break when new versions of Xcode are released.
'netX.0-ios' resolves the latest version of the iOS SDK otherwise.
-->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net11.0-ios26.5</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net11.0-ios27.0</TargetFrameworks>

<OutputType>Exe</OutputType>
<RootNamespace>Sentry.Maui.Device.IntegrationTestApp</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="11.0.0-rc.1.26425.128"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="11.0.0-rc.1.26425.128" PrivateAssets="all"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="11.0.0-rc.2.26504.105"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="11.0.0-rc.2.26504.105" PrivateAssets="all"/>
<ProjectReference Include="..\..\src\Sentry.AspNetCore.Blazor.WebAssembly\Sentry.AspNetCore.Blazor.WebAssembly.csproj" />
</ItemGroup>

Expand Down
112 changes: 0 additions & 112 deletions samples/Sentry.Samples.Ios/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ namespace Sentry.Samples.Ios;
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
public override UIWindow? Window
{
get;
set;
}

public override bool FinishedLaunching(UIApplication application, NSDictionary? launchOptions)
{
// Init the Sentry SDK
Expand Down Expand Up @@ -59,112 +53,6 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary?
};
});

#pragma warning disable CA1422 // Validate platform compatibility
// create a new window instance based on the screen size
Window = new UIWindow(UIScreen.MainScreen.Bounds);
#pragma warning restore CA1422

// determine control colours (SystemBackground requires iOS >= 13.0)
var backgroundColor = UIDevice.CurrentDevice.CheckSystemVersion(13, 0)
#pragma warning disable CA1416
? UIColor.SystemBackground
#pragma warning restore CA1416
: UIColor.White;
var buttonConfig = UIButtonConfiguration.TintedButtonConfiguration;
var terminalButtonConfig = UIButtonConfiguration.TintedButtonConfiguration;
terminalButtonConfig.BaseBackgroundColor = UIColor.SystemRed;

var vc = new UIViewController();

var label = new UILabel
{
BackgroundColor = backgroundColor,
TextAlignment = UITextAlignment.Center,
Text = "Hello, iOS!",
AutoresizingMask = UIViewAutoresizing.All
};

// UIButton for a managed exception that we'll catch and handle (won't crash the app)
var managedCrashButton = new UIButton(UIButtonType.RoundedRect)
{
AutoresizingMask = UIViewAutoresizing.All,
Configuration = buttonConfig
};
managedCrashButton.SetTitle("Managed Crash", UIControlState.Normal);
managedCrashButton.TouchUpInside += delegate
{
Console.WriteLine("Managed Crash button clicked!");
try
{
throw new Exception("Catch this!");
}
catch (Exception e)
{
SentrySdk.CaptureException(e);
}
};

// UIButton for unhandled managed exception
var unhandledCrashButton = new UIButton(UIButtonType.RoundedRect)
{
AutoresizingMask = UIViewAutoresizing.All,
Configuration = terminalButtonConfig
};
unhandledCrashButton.SetTitle("Unhandled Crash", UIControlState.Normal);
unhandledCrashButton.TouchUpInside += delegate
{
Console.WriteLine("Unhandled Crash button clicked!");
string s = null!;
// This will cause a NullReferenceException that will crash the app before Sentry can send the event.
// Since we're using a caching transport though, the exception will be written to disk and sent the
// next time the app is launched.
Console.WriteLine("Length: {0}", s.Length);
};

// UIButton for native crash
var nativeCrashButton = new UIButton(UIButtonType.System)
{
Configuration = terminalButtonConfig
};
nativeCrashButton.SetTitle("Native Crash", UIControlState.Normal);
nativeCrashButton.TouchUpInside += delegate
{
Console.WriteLine("Native Crash button clicked!");
#pragma warning disable CS0618 // Type or member is obsolete
// This will cause a native crash that will crash the application before
// Sentry gets a chance to send the event. Since we've enabled caching however,
// the event will be written to disk and sent the next time the app is launched.
SentrySdk.CauseCrash(CrashType.Native);
#pragma warning restore CS0618 // Type or member is obsolete
};

// create a UIStackView to hold the label and buttons
var stackView = new UIStackView(new UIView[] { label, managedCrashButton, unhandledCrashButton, nativeCrashButton })
{
Axis = UILayoutConstraintAxis.Vertical,
Distribution = UIStackViewDistribution.FillEqually,
Alignment = UIStackViewAlignment.Center,
Spacing = 10,
TranslatesAutoresizingMaskIntoConstraints = false,
};

// add the stack view to the view controller's view
vc.View!.BackgroundColor = backgroundColor;
vc.View.AddSubview(stackView);

// set constraints for the stack view
NSLayoutConstraint.ActivateConstraints([
stackView.CenterXAnchor.ConstraintEqualTo(vc.View.CenterXAnchor),
stackView.CenterYAnchor.ConstraintEqualTo(vc.View.CenterYAnchor),
stackView.WidthAnchor.ConstraintEqualTo(vc.View.WidthAnchor, 0.8f),
stackView.HeightAnchor.ConstraintEqualTo(vc.View.HeightAnchor, 0.5f)
]);

Window.RootViewController = vc;

// make the window visible
Window.MakeKeyAndVisible();

return true;
}
}
Loading