Skip to content
This repository has been archived by the owner. It is now read-only.

Commit 5f9dcd8

Browse files
committed
Fix SL build
1 parent 389a93f commit 5f9dcd8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Source/MethodCall.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,22 @@ private void SetFileInfo()
188188
var mockAssembly = Assembly.GetExecutingAssembly();
189189

190190
// Move 'till we're at the entry point into Moq API
191-
var frame = new StackTrace(true).GetFrames()
191+
#if !SILVERLIGHT
192+
var frame = new StackTrace(true)
193+
#else
194+
var frame = new StackTrace()
195+
#endif
196+
.GetFrames()
192197
.SkipWhile(f => f.GetMethod() != thisMethod)
193198
.SkipWhile(f => f.GetMethod().DeclaringType == null || f.GetMethod().DeclaringType.Assembly == mockAssembly)
194199
.FirstOrDefault();
195200

196201
if (frame != null)
197202
{
198203
this.FileLine = frame.GetFileLineNumber();
204+
#if !SILVERLIGHT
199205
this.FileName = Path.GetFileName(frame.GetFileName());
206+
#endif
200207
this.TestMethod = frame.GetMethod();
201208
}
202209
}

0 commit comments

Comments
 (0)