File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Sentry.Bindings.Cocoa/buildTransitive Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 4949 </ItemGroup >
5050 </Target >
5151
52+ <!--
53+ Ensure the AppDomain.CurrentDomain.UnhandledException gets triggered - see:
54+ https://github.com/xamarin/xamarin-macios/issues/15252
55+ Not supported on the CoreCLR - see:
56+ https://github.com/xamarin/xamarin-macios/blob/0a81da28e4217624a54ccb83541e1eb8ba651fca/runtime/runtime.m#L2480-L2491
57+
58+ The condition is a bit hacky - it relies on:
59+ https://github.com/xamarin/xamarin-macios/blob/0ab074390689880fe9269804a0156341d30251f6/dotnet/targets/Xamarin.Shared.Sdk.targets#L1004-L1006
60+ -->
61+ <PropertyGroup Condition =" '$(_XamarinRuntime)' != 'CoreCLR'" >
62+ <MtouchExtraArgs >--marshal-managed-exceptions=unwindnativecode</MtouchExtraArgs >
63+ </PropertyGroup >
64+
5265</Project >
Original file line number Diff line number Diff line change 11using Sentry . Cocoa ;
22using Sentry . Cocoa . Extensions ;
33using Sentry . Extensibility ;
4+ using Sentry . Internal ;
5+ using Sentry . PlatformAbstractions ;
46
57// ReSharper disable once CheckNamespace
68namespace Sentry ;
@@ -10,10 +12,10 @@ public static partial class SentrySdk
1012 private static void InitSentryCocoaSdk ( SentryOptions options )
1113 {
1214 options . LogDebug ( "Initializing native SDK" ) ;
13- // Workaround for https://github.com/xamarin/xamarin-macios/issues/15252
1415 ObjCRuntime . Runtime . MarshalManagedException += ( _ , args ) =>
1516 {
16- args . ExceptionMode = ObjCRuntime . MarshalManagedExceptionMode . UnwindNativeCode ;
17+ // This MAY be overriden in Sentry.Bindings.Cocoa.targets
18+ options . LogDebug ( $ "MarshalManagedExceptionMode: { args . ExceptionMode } ") ;
1719 } ;
1820
1921 // Set default release and distribution
You can’t perform that action at this time.
0 commit comments