Share via


How to: Debug With Code Center Premium Source

With the Visual Studio 2008 debugger, you can debug secure shared source from Microsoft MSDN Code Center Premium.

This topic explains how to set up and debug Code Center Premium source code in Visual Studio.

To prepare for debugging with Code Center Premium

  1. Connect your SmartCard reader and insert the card you obtained from the Shared Source Initiative.

  2. Launch Visual Studio.

  3. On the Tools menu, click Options.

  4. In the Options dialog box, open the Debugging node and click General.

  5. Clear the Enable Just My Code (Managed Only) check box.

  6. Select Enable Enable Source Server Support.

  7. Under the Debugging node, click Symbols.

  8. In the Symbol File (.pdb) Locations box, add the following location:

    https://codepremium.msdn.microsoft.com/symbols

    Move this location to the top of the list to ensure that these symbols are loaded first.

  9. In the Cache symbols from symbol servers in this directory box, enter a location such as C:\symbols where Code Center Premium can cache the symbols. Caching symbols can significantly improve performance during debugging.

    If you experience difficulty debugging source code with Visual Studio after you complete this procedure, check your cache location for previously cached and outdated symbol files. Remove the outdated symbol files.

  10. Clear the Search the above locations only when symbols are loaded manually check box.

  11. Click OK.

  12. Restart Visual Studio to ensure that settings are persisted.

To debug your source code using Attach to Process

  1. Connect your SmartCard reader and insert the card you obtained from the Shared Source Initiative.

  2. Launch Visual Studio.

  3. Open your Visual Studio project.

  4. On the Tools menu, click Attach to Process.

  5. In the Attach to Process dialog box, click Select.

  6. In the Select Code Type dialog box, under Detect these code types, select Native, Managed, and Managed(v4.0).

  7. Click OK to dismiss the Select Code Type dialog box.

  8. In the Available Processes box, select the process you want to debug.

  9. Click Attach.

  10. When you are prompted to confirm your certificate, click OK. Then enter your PIN. Accept the terms of use for Code Center Premium, if you are prompted,.

    Downloading symbols can take lots of time, depending on the network speed. The status bar will indicate when all symbols have been downloaded successfully.

  11. Repeat the attach steps for all managed projects in your Solution.

To debug source code from an existing solution

  1. In Solution Explorer, right-click a managed project and select Properties.

  2. In Project Properties, click the Debug node, and then select Enable unmanaged code debugging. Close the dialog box.

  3. Repeat steps 1 and 2 for every managed project in your solution.

To debug your solution with Code Center Premium source

  1. In your Package class, set a breakpoint on the package constructor.

  2. On the Debug menu, click Start Debugging.

  3. When you hit the breakpoint check box

    package constructor, go to the Call Stack window and right-click the stack frame of the assembly you want to load symbols from. Then, click Load Symbols.

    Double-click the call frame to load the source.

To browse source code on Code Center Premium

  1. Connect your SmartCard reader and insert the card you obtained from the Shared Source Initiative.

  2. Launch Internet Explorer and type the following URL: https://codepremium.msdn.microsoft.com

  3. Browse to find the source you want.

See Also

Concepts

Debugger Security

Other Resources

Debug Settings and Preparation

Code Center Premium

Change History

Date

History

Reason

July, 2010

Updated to reflect current Code Center Premium workflow.

Content bug fix.