Skip to content

Commit e298d65

Browse files
authored
Add DebuggerDisableUserUnhandledExceptionsAttribute
1 parent 382e271 commit e298d65

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/Consume/Consume.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class Consume
8585
type = typeof(DisableRuntimeMarshallingAttribute);
8686
type = typeof(RequiresUnreferencedCodeAttribute);
8787
type = typeof(UnreachableException);
88+
type = typeof(DebuggerDisableUserUnhandledExceptionsAttribute);
8889

8990
// Test to make sure there are no clashes in the Polyfill code with classes that
9091
// might be defined in user code. See comments in Debug.cs for more details.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// <auto-generated />
2+
#pragma warning disable
3+
4+
#if !NET9_0_OR_GREATER
5+
6+
namespace System.Diagnostics;
7+
8+
using Diagnostics;
9+
using Diagnostics.CodeAnalysis;
10+
11+
/// <summary>
12+
/// If a .NET Debugger is attached that supports the <see cref="Debugger.BreakForUserUnhandledException(System.Exception)" /> API, the debugger won't break on user-unhandled exceptions when the exception is caught by a method with this attribute, unless <see cref="Debugger.BreakForUserUnhandledException(System.Exception)" /> is called.
13+
/// </summary>
14+
[ExcludeFromCodeCoverage]
15+
[DebuggerNonUserCode]
16+
[AttributeUsage(System.AttributeTargets.Method)]
17+
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggerdisableuserunhandledexceptionsattribute
18+
#if PolyPublic
19+
public
20+
#endif
21+
sealed class DebuggerDisableUserUnhandledExceptionsAttribute :
22+
Attribute;
23+
#endif

0 commit comments

Comments
 (0)