I have built an SPFeatureReceiver and am trying to debug it by attaching to the w3wp.exe process. No matter what I do no breakpoints are ever hit. Here are my steps

  1. Build and Package the solution
  2. Execute Add-SPSolution PowerShell cmdlet to add wsp to SharePoint
  3. Verify the solution is installed but not deployed in Central Admin
  4. Attach Visual Studion 2010 to all w3wp.exe processes
  5. Execute Install-SPSolution PowerShell cmdlet

I am expecting but no breakpoints are hit. It does not look like symbols are loaded and I don't see anything close to my assembly in the loaded modules page of Visual Studio.

Thanks for the help

  • What scope is your Feature?
    – James Love
    Commented Jun 7, 2011 at 22:14
  • Scope is set to "Farm"
    – ChiliYago
    Commented Jun 7, 2011 at 22:21
  • Did you try a direct Debug from VS2010? This will do a deploy automatically and go into debug mode. Are the features enabled?
    – vasya10
    Commented Jun 7, 2011 at 22:48
  • Yes that does not work either. When doing so the feature does get deployed because I can see the results. However it is not fully working to my satisfaction and seeing it in debug mode should clear things up for me.
    – ChiliYago
    Commented Jun 7, 2011 at 22:57
  • Tried an IIS reset in between adding the solution and attaching the debugger?
    – James Love
    Commented Jun 7, 2011 at 22:58

2 Answers 2


Install-SPSolution starts a SharePoint Timer process, so try attaching to the owstimer process instead of w3wp.

  • Good idea but attempting to do that yields this error even though i am building in Debug mode. "The following module was built either with optimizations enabled or without debug information. To debug this module, change its project build configuration to Debug mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option."
    – ChiliYago
    Commented Jun 7, 2011 at 23:34
  • Try adding this line of code to the top of your method: System.Diagnostics.Debugger.Launch
    – Laurie
    Commented Jun 7, 2011 at 23:41
  • 1
    Adding this to the constructor worked! #if DEBUG System.Diagnostics.Debugger.Launch(); #endif
    – ChiliYago
    Commented Jun 8, 2011 at 16:37

According to this post How to debug Feature Receiver you can add this line of code to the method you are trying to debug:

  • Thanks for sharing the answer Laurie..... Its is work for me.... :)
    – Optimus
    Commented May 17, 2012 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.