Monday, July 16, 2007

VS Debugging tips

Debugging made easy
Visual studio provides a very good way to debug your code whether its running in production or test




Build the report in debug mode.
Copy pdb (Symbol file) and dll and place then in the product you want to debug. The dll copied should be used by the product.
run Product

In VS - Click 'Debug' menu - Select 'Attach to process'
Select your product running services/exe form the process list (if its not visible select 'Show processes from all users' checkbox)
click 'Attach'

Click 'Tools' menu - Select 'Options'
Expand 'Debugging' option in the right panel
Select 'Symbol' option.
Add a symbol option and give the full path of the pdb file.

Apply breakpoint at appropriate places

Now whenever the product tries to access the dll (copied) it will stop at your specified breakpoints)

No comments: