Single-Step Debugging a Visual Studio Assembly
This tutorial shows you how to debug a dot net assembly used as an addon in a Contensive site.
You should already have completed the tutorial Integrating a Visual Studio Assembly into an Addon Collection. This tutorial starts where this previous tutorial left off.
Set a Break Point to single-step through your code.
- Open your development website to the Admin site
Admin Navigator >> Manage Add-ons >> Sample Collection >> Click on Sample Addon
Your sample addon runs and displays the text returned from the Visual Studio Assembly. The default string was "Visual Studio Contensive Addon - OK Response"
- Open the Visual Studio solution for this addon.
- Set a breakpoint in the code (put the cursor on the line and hit F9). I set it on the returnHtml line.
Attach the Visual Studio Debugger to the running process and break on the break-point
- Open a command prompt "As Administrator" and run IISReset.
- Build the project.
If you get an error copying in the post-build step of the build, make sure you have not hit site since the last IISReset. You may need to reset again.
- In your browser, hit a page on your website.
- Go to Visual Studio and attach to the new IIS Process you just created by hitting a page.
In Visual Studio, click the Tools menu
Click the Attach to Process (Ctrl-Alt-P)
If your development site runs on PHP, the process(es) will be php-cgi.exe. Be sure to attach to all processes you find.
- Go back to your site and hit the page that includes your addon. The Visual Studio break point hits and you can single-step through your assembly code.
If you followed these steps and the breakpoint does not hit
- Try again.
- In the Attach to process dialog, verify a new process has not started. If so, select it as well and hit the page again.
- In the Attach to Process dialog, under Attach To:, open the Select Code Type dialog and try both Automatic (the default), and "Managed (v2.0, v1.1, v1.0)"