Sdílet prostřednictvím


How to: Debug with Code Center Premium Source

With the Visual Studio 2010 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. Clear Require source files to exactly match the original version.

  8. Under the Debugging node, click Symbols.

  9. In the Symbol File (.pdb) Locations box, clear the Microsoft Server Symbols check box and 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.

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

  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 the 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. In the Debug menu, click Start Debugging.

  3. When you hit the breakpoint in the 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 enter 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.