SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
What scope is your Feature? – James Love Jun 7 '11 at 22:14
Scope is set to "Farm" – ChiliYago Jun 7 '11 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 Jun 7 '11 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 Jun 7 '11 at 22:57
Tried an IIS reset in between adding the solution and attaching the debugger? – James Love Jun 7 '11 at 22:58
up vote 1 down vote accepted

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

share|improve this answer
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 Jun 7 '11 at 23:34
Try adding this line of code to the top of your method: System.Diagnostics.Debugger.Launch – Laurie Jun 7 '11 at 23:41
Adding this to the constructor worked! #if DEBUG System.Diagnostics.Debugger.Launch(); #endif – ChiliYago Jun 8 '11 at 16:37
You should accept the answer below, since it actually solved your problem. – Laurie Jun 8 '11 at 16:42

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

share|improve this answer
Thanks for sharing the answer Laurie..... Its is work for me.... :) – Optimus May 17 '12 at 5:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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