Visual Studio Team System: How to set a breakpoint and debug a Test

There are many ways to run a test in VSTS: From the Test View window, from the Test List window, and from the Test Results window, to name a few. VSTS then runs the test in the IIS or the ASP.NET Development Server Process. But what if you want to step through a test? How do you set a breakpoint?

Microsoft has documented the "official" answer here:

However, I have found a much simpler way to accomplish this:

Run your tests from within Visual Studio runtime. To do this, rather than running your tests from any of the interfaces provided as part of VSTS, run your test project from within the IDE.

In the Solution Explorer, left-click on your test project and select "Set as StartUp Project". Then set your breakpoints and run your solution.

You can now step through and debug any test. The downside is that all the tests in the Test Project will run, but for my purposes this solution is still much easier than going through all the steps to do it the other way.

Print | posted on Friday, June 06, 2008 3:03 PM

Feedback

No comments posted yet.

Your comment:





 
 

Copyright © Kirstin Juhl

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski