Visual Studio Hacks [Electronic resources]

Andrew Lockhart

نسخه متنی -صفحه : 172/ 66
نمايش فراداده

Hack 37. Troubleshoot Breakpoints

Use an online web application to figure out why your breakpoints aren't working.

In [Hack #36], we discussed the various ways to set and use breakpoints, but sometimes your breakpoints just don't work. Andy Pennell, the development lead at Microsoft responsible for the Visual Studio debugger, has created a small web application that will help you troubleshoot problems with your breakpoints. To use this tool, you simply answer the questions and then follow any steps or recommendations that the tool makes. Let's take a look at the tool in action.

The breakpoint helper can be found at http://www.controlav.com/bphelper and is shown in Figure 5-10.

Figure 5-10. Visual Studio Debugger Breakpoint Helper

To start using the helper, simply click Start Helper. The next screen asks you what version of Visual Studio you are using and is shown in Figure 5-11.

Figure 5-11. Which Product Do You Have?

Select the version of Visual Studio that you are currently using. For this example, I am going to select Visual Studio 2003. The next screen asks you what kind of breakpoint you are currently using and is shown in Figure 5-12.

Figure 5-12. What Kind of Breakpoint?

For this example, I am going to select File/Line, the most common type of breakpoint. The next screen asks what kind of code this breakpoint is set on and is shown in Figure 5-13.

Figure 5-13. What kind of code is your breakpoint set in?

From here, I am going to choose Managed Code. The next screen asks whether any breakpoints are working and is shown in Figure 5-14.

Figure 5-14. Do Any Managed Breakpoints Work At All In Any Project?

This step tells you to try creating a new blank project and see if the breakpoints work in that project. Let's suppose that they don't work in the new project either, so I click No and then see the screen in Figure 5-15.

Figure 5-15. You Need to Reinstall the .NET Framework

The breakpoint helper has determined that I would need to reinstall the .NET framework to fix this issue. The breakpoint helper is a very valuable tool and should be the first place you turn whenever you have problems with your breakpoints not working correctly.