Running VSTS tests without mstest.exe

October 21, 2009


I’ve been looking at ways to run VSTS tests without using the actual Visual Studio testing framework. It all started when I wanted to integrate code-coverage in our TeamCity daily build. All the solutions I found were using the NUnit runner for this, and while I could have used mstest.exe to run the tests when I’m gathering code-coverage, I didn’t want to. Why? Well, because:

  1. TeamCity doesn’t use it to run the tests, so I might get different result from the regular test-run and the code-coverage test-run.
  2. It requires me to install Visual Studio on the server.
  3. It creates annoying TestResult folders.
  4. It requires maintaining a testrun.config file.

In essence, using mstest.exe just seems a lot more cumbersome. Still, all our tests are indeed using the VSTS attributes, so I need a way to run them “NUnit-style”, i.e. without mstest.exe. TestDriven.Net and TeamCity already seem to be doing this, but without exposing anything that I could use. Google did not help, neither. So, I turned to ask at After a while, an answer was received by a fellow named Bryan Cook: an addin to NUnit exist, but alas, it turns out it doesn’t support the latest NUnit version. Kindly enough, Bryan just went and fixed it. Not a trivial task, mind you, as I had a look at the code, and it seems that the NUnit API went through quite a lot of changes going into version 2.5.

Anyway, you can go over and download the addin from right here. Thanks Bryan!

On a different note, we ended up deciding to switch all our tests to NUnit at the end, but I’m sure this could come handy in the future 🙂

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



  1. BryanOctober 22, 2009 ב 3:59

    Hey Doron,

    Thanks for the kind words, and your most welcome. Shame that you ended up switching in the end, I was hoping to get some feedback and potentially add support for the AssemblyInitialize attributes.

    Glad to see we both blogged about this 😀

  2. Joe FeserOctober 22, 2009 ב 15:12

    You can install the .net SDK on the build server without installing visual studio.

    You can also use NCover for code coverage.

  3. doronyOctober 22, 2009 ב 19:11

    Joe – I am trying to use NCover, but NCover requires a test-runner, and I didn’t want to use mstest.exe for that. Hence, the topic.