Debugging Design-Time Code


To debug design-time code, you will need two instances of Visual Studio .NET ”one for performing design-time actions and the other for performing debugging operations. The following steps describe how to perform design-time debugging:

  1. Start Visual Studio .NET, and open the project that contains the controls and the associated design-time classes that you want to debug.

  2. Bring up the property pages for the project. Under Configuration Properties in the left pane, click Debugging. In the right pane, under Start Action, set Debug Mode to Program and set Start Application to devenv.exe. (If devenv.exe is not included in the path environment variable of your computer, you will have to provide the full path to it.) These two properties will cause the debugger to launch a new instance of Visual Studio .NET when the debugger is started.

  3. Set breakpoints in your code, and start the debugger via the Debug menu or by pressing F5 on the keyboard.

  4. A second instance of Visual Studio .NET will now appear on your screen. In this instance, create a new ASP.NET Web application and add a reference to the debug version of the project that contains the code you want to debug.

  5. In the Web application in the second instance of Visual Studio .NET, drag a control from the Toolbox onto the page. The debugger will pause as soon at it hits the first breakpoint in your code. If you have set a breakpoint in the designer for the control, the debugger will pause as soon as the control is dropped on the design surface.

  6. You can now perform normal debugging operations in the first instance of Visual Studio .NET.



Developing Microsoft ASP. NET Server Controls and Components
Developing Microsoft ASP.NET Server Controls and Components (Pro-Developer)
ISBN: 0735615829
EAN: 2147483647
Year: 2005
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net