MSTest with TestRunner inside LinqPad - Unresolved references in LinqPad.dll for a query

Hello there,

My goal is to run MsTests in LinqPad the same way I can NUnit inspired by this blog post(

I have found this for running the tests via the console.

I managed to get it that far:

void Main()
// if is in the same process!
var testAsssembly = Assembly.GetExecutingAssembly().Location.Dump();

var testRunner = typeof(TestRunner.Program.TestResult).Assembly.Location.Dump();

Util.Cmd(testRunner, testAsssembly);

public class Tests
public static void AlwaysTrue()

with references added via NuGET:
MsTest.TestFramework, TestRunner

The error I get is :
"An internal error occurred in TestRunner.exe:
Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.TestFramework, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Type: System.IO.FileNotFoundException"

Out of curiosity I decompiled just the LinqPad.dll for the query in ILSpy (standalone) and found the same "unresolved" reference.

I would appreciate any help.


  • Press F4 to Open Query Properties.
    Go to Advanced and select 'Copy all non-framework references to a single local folder'

    Also, I need you change your AlwaysTrue() method to be non-static.
  • Thanks. It worked!

    Even the setting "Copy all non-framework references to a single local folder'" was saved in the snippet I created.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!