Tag Archives: Visual Studio

How to debug your tests without Re# in a jiffy

Resharper is a crutch






1. In Visu­al Stu­dio, right click on the NUnit Test project, select the Prop­er­ties option.
2. Go to the Debug tab, select the ‘Start Exter­nal Pro­gram’ radio but­ton. Browse to packages\NUnit.Runners.2.6.2\tools\nunit.exe
3. In the ‘Com­mand line argu­ments’ enter the test DLL (exam­ple — XYZ.ABC.Tests.dll). Don’t for­get the .dll
4. Make the test project as start­up project by right-click­ing on the project in the Solu­tion Explor­er and select­ing Set as Start­up Project.
Hit F5 to launch NUnit, select and run the appro­pri­ate test method to be debugged, and enjoy the debug­ging good­ness.

Note — Due to NUnit ver­sions and .net ver­sions incom­pat­i­bil­i­ties, you may still not be able to debug. In that case, go to packages\NUnit.Runners.2.6.2\tools and find nunit.exe.config and edit the start­up to be
<start­up useLegacyV2RuntimeActivationPolicy=“true”>
<!– Com­ment out the next line to force use of .NET 4.0 –>
<require­dRun­time version=“4.0.30319” />
edit nunit-agent.exe.config’s <start­up> to be
<start­up useLegacyV2RuntimeActivationPolicy=“false”>
<sup­port­e­dRun­time version=“v4.0.30319” />