Added backwards compatible StackTraceHiddenAttribute for pre-NET 6.0

nullableenabled
David Hall 2024-04-27 12:51:14 -06:00
parent dc62d8c478
commit 01c31c3638
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#if !(NET6_0_OR_GREATER)
namespace System.Diagnostics;
/// <summary>
/// Types and Methods attributed with StackTraceHidden will be omitted from the stack trace text shown in StackTrace.ToString() and Exception.StackTrace
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
public sealed class StackTraceHiddenAttribute : Attribute
{
/// <summary>Initializes a new instance of the <see cref="StackTraceHiddenAttribute"/> class.</summary>
public StackTraceHiddenAttribute() { }
}
#endif