Jun 30 2009

Windows 7 VS 2008 Unit Test Fail – VSTestHost Hang Fix

Category: AlexRobson @ 14:24


I have no idea how many other over-eager devs there are out there who currently do a lot of development on Windows 7’s RC (I’m on build 7100) in Visual Studio 2008 SP1. I hadn’t gotten very far before running into a problem. The behavior was that the test host would hang and you wouldn’t get test results and, if you’re doing something a little different in the test, you might make the assumption, as I first did, that your code was causing the issue. (I was hosting WCF services in the test setup)

Well, it’s a known VS 2008 SP1 issue on Windows 7 and after digging around I found the fix: http://code.msdn.microsoft.com/970449/Release/ProjectReleases.aspx?ReleaseId=2830

Hopefully this entry will help those struggling with the issue to stumble on the fix. Happy unit testing : )

Tags:

Comments

1.
Matt Matt United States says:

People actually use the Microsoft test runner?  Seriously? *shudder*

NUnit + TestDriven.NET is the only way to go.  Or NUnit + Resharper. A major disadvantage of MsTest is that people who don't have a Team edition of Visual Studio won't be able to run your tests.  NUnit is freely available, extensible, and faster (from my own personal experience).  

2.
Dan Swatik Dan Swatik United States says:

Hmm I'm on Windows 7 and haven't had this issue but incase I do it's good to know there is a fix. As far as what @Matt says there is nothing wrong with MsTest it works fine, we all use the tools that work for us another words if it isn't broke don't fix it. Also it's not only limited to the Team edition I do unit tests in the professional edition.

3.
Matt Matt United States says:

@Dan, hmm, apparently they changed that in VS2008.  In 2005, it was a Team Dev+ only feature.  Doesn't help me anyway though since I'm stuck on Standard here at work.  

I still stand by my statement, no one should be using MsTest.  It is a great example of Microsoft reinventing a perfectly good wheel, only they made it square instead of round, then set it on fire.

4.
Ryan Ryan United States says:

Thanks very much, Alex! I do dev on win7 7100 build and had the same problem. But not any more!

Gotta love the nice integration with VS2008 that you get with MsTest Smile!

5.
pr0nin pr0nin Norway says:

I've had this exact problem on a new installation of Win7, VS2008 and Resharper. The Resharper test runner would hang forever, so I naturally assumed it was the culprit. After a little back and forth I discovered that the same exact thing happened when using MSTtest runner. Uninstalled Resharper. Problem still there. Then found this page. Installed the fix and the MSTest runner now works Laughing Off to reinstall Resharper crossing my fingers it'll work as expected.

6.
xtc-templates xtc-templates Germany says:

It is a great example of Microsoft reinventing a perfectly good wheel.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading