Wow - That Was Annoying

Published 18 November 07 06:18 PM

So I'm in an awkward place right now when it comes to programming.  In addition to the fact that I no longer program on a day-to-day basis (which is starting to bug me a little more than it used to as I'm afraid I'm starting to atrophy a bit), I'm also now up on Visual Studio 2008 - which is really great in a lot of respects - but at the same time is kind of bumming me out.  I'm not bummed because of anything inherent in Visual Studio - I'm bummed because Resharper just doesn't really work all that great in it.  Don't get me wrong - R# works - but the semantic analysis tools don't yet work with a lot of the C# 3.0 language enhancements - and as much as I tried to ignore the R# compiler errors on things like Linq queries, I finally just got tired of it an uninstalled R#, impatiently awaiting the 4.0 release.

Firstly, let me just say that not having R# is miserable from a refactoring standpoint.

Secondly, losing R# led me down the path to another headache (which is the subject of this post) - I no longer have a VS add-in runner for NUnit.  Yes, I know - I could (and probably should) go back and download TD.NET - but instead, I was curious to see how easily it would be for me to just convert my NUnit tests to VS 2008 unit tests.  In short, it's not terribly difficult, but getting there was a frustrating journey.

Why?  Because unlike NUnit, where a test fixture is explicit in code (and only in code) via the TestFixture attribute, VS tests rely on a second piece of metadata in order to have them run via the VS test manager/test runner.  That metadata is not found in the *.vsmdi file - instead, it's actually a property in the project file of your unit test project.

Therefore, if you started from a regular class library project and need to have it recognized by VS as a "test project", open the *.csproj file in notepad and add the following to any PropertyGroup.

<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

The first Guid identifies your project as a test project (the second is the language I believe - feel free to correct me if I'm wrong).

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# links for 2008-03-20 « dstelow notes… said on March 20, 2008 7:25 PM:

PingBack from http://dstelow.wordpress.com/2008/03/20/links-for-2008-03-20/

Leave a Comment

(required) 
(optional)
(required) 

About hdierking

I am currently the Editor-in-Chief for MSDN Magazine. I joined Microsoft in 2006 as a product planner with the certification team at Microsoft Learning. Prior to that, I spent my career as a developer and later as an architect. My main technology passions include pretty much anything on language theory, agile development, and service-oriented architecture.
Page view tracker