Login

Recover Your Password

Return to Product Support > Learning Center > Developer References > Developer Tutorials > Single-Step Debugging a Visual Studio Assembly

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 CollectionThis tutorial starts where this previous tutorial left off. 

Set a Break Point to single-step through your code.

  1. 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"

  2. Open the Visual Studio solution for this addon.

  3. 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

  1. Open a command prompt "As Administrator" and run IISReset.

  2. 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.

  3. In your browser, hit a page on your website. 

  4. 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.

  5. 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

  1. Try again.
  2. In the Attach to process dialog, verify a new process has not started. If so, select it as well and hit the page again.
  3. 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)"