Skip to content

Commit 0dddcc5

Browse files
Point to DMI.Create from RUC message on StackFrame.GetMethod (#103400)
Should help discoverability.
1 parent ae80f73 commit 0dddcc5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Diagnostics/StackFrame.NativeAot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public partial class StackFrame
3939
/// <summary>
4040
/// Returns the method the frame is executing
4141
/// </summary>
42-
[RequiresUnreferencedCode("Metadata for the method might be incomplete or removed")]
42+
[RequiresUnreferencedCode("Metadata for the method might be incomplete or removed. Consider using " + nameof(DiagnosticMethodInfo) + "." + nameof(DiagnosticMethodInfo.Create) + " instead")]
4343
public virtual MethodBase? GetMethod()
4444
{
4545
TryInitializeMethodBase();

src/libraries/System.Diagnostics.StackTrace/ref/System.Diagnostics.StackTrace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public StackFrame(string? fileName, int lineNumber, int colNumber) { }
181181
public virtual int GetFileLineNumber() { throw null; }
182182
public virtual string? GetFileName() { throw null; }
183183
public virtual int GetILOffset() { throw null; }
184-
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Metadata for the method might be incomplete or removed")]
184+
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Metadata for the method might be incomplete or removed. Consider using DiagnosticMethodInfo.Create instead")]
185185
public virtual System.Reflection.MethodBase? GetMethod() { throw null; }
186186
public virtual int GetNativeOffset() { throw null; }
187187
public override string ToString() { throw null; }

src/libraries/System.Private.CoreLib/src/System/Diagnostics/StackFrame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public StackFrame(string? fileName, int lineNumber, int colNumber)
138138
/// <summary>
139139
/// Returns the method the frame is executing
140140
/// </summary>
141-
[RequiresUnreferencedCode("Metadata for the method might be incomplete or removed")]
141+
[RequiresUnreferencedCode("Metadata for the method might be incomplete or removed. Consider using " + nameof(DiagnosticMethodInfo) + "." + nameof(DiagnosticMethodInfo.Create) + " instead")]
142142
public virtual MethodBase? GetMethod()
143143
{
144144
return _method;

0 commit comments

Comments
 (0)