Infosys Microsoft Alliance and Solutions blog

« ASP.NET Unit Testing on IIS | Main | Unit Test Trust Issue on Vista »

Debugging ASP.NET Unit Tests with VS 2008

In my previous blogs (here and here), I have been discussing about unit testing on an ASP.NET web site that is hosted on IIS. While doing the work on that, I also had a need to debug my test case. The documentation on MSDN talks about putting break points and attaching to w3wp process and then debug the tests.

This however didn't work for me on VS 2008. What worked was adding the System.Diagnostics.Debugger.Break() call in my code and then running the tests like normal. When the code hit the Debugger.Break line, it asked me, which debugger to use and I selected the already open VS 2008 instance and it took me to the correct line of code and i was able to debug.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter