Export (0) Print
Expand All

How to: Debug a Feature Receiver

Overview

One of the new features in the Microsoft® Visual Studio® 2010 development system is the ability to press F5 to debug Microsoft SharePoint® components, such as feature receivers. However, to debug a feature receiver class, you must configure your SharePoint project to use the No Activation deployment configuration. This means that Visual Studio 2010 will install your features, but you must manually activate them through the user interface. This how-to topic describes how to change your deployment configuration and debug a feature receiver class.

Ff798479.note(en-us,PandP.10).gifNote:
This how-to topic uses the ExecutionModels.Sandboxed solution as an example of a project with feature receiver classes.

Steps

To debug a feature receiver in Visual Studio 2010

  1. Open the Visual Studio 2010 project that contains your feature.
  2. In Solution Explorer, right-click the project node, and then click Properties.
  3. On the SharePoint tab, in the Active Deployment Configuration drop-down list, click No Activation.

    Ff798479.ae6c6416-fb63-4642-b534-b78f306132db(en-us,PandP.10).png

  4. Open the feature receiver class that you want to debug, and then insert a breakpoint.

    Ff798479.3147401d-1da9-472d-9003-c91b9e7b2230(en-us,PandP.10).png

  5. Press F5 to deploy and debug your solution. In the Attach Security Warning dialog box, click OK.
  6. Activate your feature through the browser user interface.

    Ff798479.d0205272-193a-49fa-a51c-c9bffc69a358(en-us,PandP.10).png

  7. Verify that the debugger stops at your breakpoint.

    Ff798479.936dda81-0326-427c-be60-3beb42a6ff02(en-us,PandP.10).png



Show:
© 2014 Microsoft