From 01c31c3638f2000cdbfa18bd9040eb5cdcd457ab Mon Sep 17 00:00:00 2001 From: David Hall Date: Sat, 27 Apr 2024 12:51:14 -0600 Subject: [PATCH] Added backwards compatible StackTraceHiddenAttribute for pre-NET 6.0 --- Core/BkwdComp/StackTraceHiddenAttribute.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Core/BkwdComp/StackTraceHiddenAttribute.cs diff --git a/Core/BkwdComp/StackTraceHiddenAttribute.cs b/Core/BkwdComp/StackTraceHiddenAttribute.cs new file mode 100644 index 00000000..4a568cb0 --- /dev/null +++ b/Core/BkwdComp/StackTraceHiddenAttribute.cs @@ -0,0 +1,13 @@ +#if !(NET6_0_OR_GREATER) +namespace System.Diagnostics; + +/// +/// Types and Methods attributed with StackTraceHidden will be omitted from the stack trace text shown in StackTrace.ToString() and Exception.StackTrace +/// +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)] +public sealed class StackTraceHiddenAttribute : Attribute +{ + /// Initializes a new instance of the class. + public StackTraceHiddenAttribute() { } +} +#endif \ No newline at end of file