NUnit integration in Visual Studio 2008 and 2010.

This add-in for Visual Studio Team System will allow you to run NUnit tests just like Visual Studio Unit tests integrated in Visual Studio 2008 and 2010. It makes Visual Studio to see NUnit test as mstest. That means everything you can do with Visual Studio Unit tests you can also do with NUnit tests. For example publishing of results in TFS or code coverage. In Visual Studio 2012 the NUnit Test adapter can be used instead http://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d

How to

Visual Studio (Professional, Developer and Tester Editions) are capable of running unit tests. Unfortunatly it does not support NUnit tests. Converting NUnit tests to Visual Studio unit tests takes time and sometimes not possible. That's why this utility. It allows Visual Studio to see and run NUnit tests without changing any code.

Visual Studio "marks" all test projects with some special Guids. Thats why you have to first convert your NUnit test project to a "Test Project".
To do this open your solution. In Solution Explorer right click on a project that you want to make a test project and select "Unload Project". This will allow you to edit project csproj file. Once more right click on project and select "Edit <projectname>.csproj". This will open csproj file in editor. Now you have to add following tag in first <PropertyGroup> tag:
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
For Visual basic you need the following tag in first <PropertyGroup> tag:
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
Now close the project file in editor saving the changes, right click on project in Solution Explorer and select "Reload Project". Now Visual Studio recognize this project as a test project and you can see and run Visual Studio unit tests.

Now go in menu Test->Windows->Test View. You should now see your NUnit tests in Test View window. Test list is being refreshed after each successful project build.

Dev Team info:

This project is started by nesher,. The 2008 version and the updates since are developed by Info Support in the netherlands.

Last edited Feb 15, 2013 at 12:29 PM by rolfhuisman, version 14