Just My Code

Just My Code debugging, a new feature in Visual Studio 2005, provides a way to have the debugger step into only the code you've written. Visual Studio 2005 will step over automatically generated code and code from referenced assemblies so that you can look only for your own coding errors.

Earlier in this chapter, you learned about some of the hidden files behind the classes that contain auto-generated code. The code is stored in a separate file as a way to separate this auto-generated code from the code you write. Enabling the Just My Code setting ensures that as you step through your code, the debugger executes the code in these hidden files without stepping into any of the auto-generated code. This works because the generated code is marked with an attribute that indicates that it should not be considered as belonging to "Just My Code."

However, if you're interested in learning about the code in these hidden files, you can disable the Just My Code setting and step through calls into these code files. To disable Just My Code, click the General tab of the Debugging node in the Options dialog box and clear the Enable Just My Code (Managed Code) check box. Again, keep in mind that you should not modify code in these hidden files because regeneration of the files can overwrite any changes you've made.

0 0

Post a comment