Derik Whittaker



Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at
Clean build server with MSTest == FAIL

It is no secret that I am not a fan of MSTest (read here for more rants on MSTests).  Today's rant is about how MSTest does not allow you to have a clean build server.

Yea I know what you are thinking, here comes another long winded rant on MSTest.  Well this should not be too long winded, and hey, it is my blog and I can rant if I want to :).

This week I was trying to setup our build server and I need it to run MSTest tests.  I know that MSTest does not run like NUnit, but thought for sure there was a way I could get my tests to run without having to install the full blown version of Visual Studio.  After a bit of searching and asking others I came to final conclusion that in fact you cannot get MSTest to run without Visual Studio. 

This is an issue to me because when I setup my build server I like to keep it clean.  I do NOT want to install any 3rd party software.  The way I see it is like this.  If we are not going to install the software package on the end users computer, why should I need to install them on our build server, and the last time I checked we do not install Visual Studio on our end users computer.

This is another issue to me because MSTest is the ONLY test framework (for .Net) that I know of that does not run with a single DLL placed into the bin (or any other output directory).  I just have to ask the genius' over in Redmond what the hell were they smoking when they decided to build MSTest.  It is pretty clear they had no prior knowledge of how to use the other tools such as NUnit, MBUnit or xUnit (I know, xUnit was not out yet).  I know this because of all the various testing frameworks MSTest is the one that does everything different.  You could argue they were on the cutting edge and were innovating, but I call BS on that.

Anyway, I feel better now telling the world another reason why I am not a fan of MSTest.  Sadly I am stuck using it for now and at least in the short term as we have hundred of tests already written in MSTest.  But rest assured that I am on a crusade to get our team to switch from MSTest to NUnit (or any other logical framework).

Till next time,

[----- Remember to check out DimeCasts.Net -----]

Posted 09-25-2008 5:10 AM by Derik Whittaker
Filed under: ,



redsolo wrote re: Clean build server with MSTest == FAIL
on 09-25-2008 2:51 PM

I hear your pain ( On my previous job I actually used both NUnit and MSTest to test our apps, I was able to annotate the test methods/classes with annotations from both frameworks. Thereby I could run the tests on the CI server using NUnit and in the IDE.

But I think NUnit had a MSTest compability a long time ago, perhaps that could be looked into again?

Dave Schinkel wrote re: Clean build server with MSTest == FAIL
on 09-28-2008 2:55 PM

I personally do love NUnit and TestDriven.NET.  Haven't used MSTest but I'm not surprised.  If Microsoft can't build a decent build server in the first place (TFS) as opposed to a good build / source control software such as Subversion, why would I think the fancy UI in MSTest would be any better.  The only good development tool MS has build for developers is Visual Studio and lets leave it at that.

But at the same token, I don't see a problem with installing VS on your test server.  Sure yes, while the famous "keep it clean" phrase makes sense, I'm not that anal about just putting an instance of VS on my server.

Jeremy Wiebe wrote re: Clean build server with MSTest == FAIL
on 10-01-2008 7:49 PM

We're using MSTest at work and I feel your pain.  I wonder if the reason why MSTest lags behind the other unit tests suites is because Microsoft wasn't really targetting TDD folks when they build it, but rather the corporate developer who wants to check of the box that says "I unit tested my code".  I cringe ever time I see unit tests that have been created using the "Generate unit tests" feature in Visual Studio (TestFriends.vb or .cs is evil :-) )

On the topic if build servers one similar issue that drives me nuts is 3rd party control suites that insist that you have installed the full suite on the build server for you to build any software that uses their suite.  (as opposed to just dropping the control dll's in a /lib directory in the source tree).  

Joshua Flanagan wrote re: Clean build server with MSTest == FAIL
on 10-13-2008 3:00 PM

I don't remember the specifics, but I'm pretty sure I looked into this in the past and was able to make it work. You don't necessarily need to install VS - you just need to copy files from the right directories. Look under Program Files\MSBuild\Microsoft on a machine with VS installed. I think the MSBuild task DLL and targets files are in there. Copy them into your bin folder, and then update your MSBuild script to reference them appropriately.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)