Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 6c41702

Browse files
author
Mike McLaughlin
authored
Fix building on desktop bug #234633. (#6045)
ifdef the references to System.Diagnostic.StackFrame.
1 parent f339d85 commit 6c41702

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mscorlib/src/System/Diagnostics/Stacktrace.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ private delegate void GetSourceLineInfoDelegate(string assemblyPath, IntPtr load
6161
IntPtr inMemoryPdbAddress, int inMemoryPdbSize, int methodToken, int ilOffset,
6262
out string sourceFile, out int sourceLine, out int sourceColumn);
6363

64+
#if FEATURE_CORECLR
6465
private static Type s_symbolsType = null;
6566
private static MethodInfo s_symbolsMethodInfo = null;
6667

6768
[ThreadStatic]
6869
private static int t_reentrancy = 0;
70+
#endif
6971

7072
public StackFrameHelper(Thread target)
7173
{
@@ -109,6 +111,7 @@ internal void InitializeSourceInfo(int iSkip, bool fNeedFileInfo, Exception exce
109111
{
110112
StackTrace.GetStackFramesInternal(this, iSkip, fNeedFileInfo, exception);
111113

114+
#if FEATURE_CORECLR
112115
if (!fNeedFileInfo)
113116
return;
114117

@@ -161,10 +164,12 @@ internal void InitializeSourceInfo(int iSkip, bool fNeedFileInfo, Exception exce
161164
{
162165
t_reentrancy--;
163166
}
167+
#endif
164168
}
165169

166170
void IDisposable.Dispose()
167171
{
172+
#if FEATURE_CORECLR
168173
if (getSourceLineInfo != null)
169174
{
170175
IDisposable disposable = getSourceLineInfo.Target as IDisposable;
@@ -173,6 +178,7 @@ void IDisposable.Dispose()
173178
disposable.Dispose();
174179
}
175180
}
181+
#endif
176182
}
177183

178184
[System.Security.SecuritySafeCritical]

0 commit comments

Comments
 (0)