1

Is it possible to debug FeatureActivated?

I am doing:

  1. Deploy ->
  2. Set Breakpoint in the public override void FeatureActivated ->
  3. Attach the process to the debugger ->
  4. refresh.

This doesn't work because the app has already been deployed and activated.

How do I tell it to insta-stop and let me walk through the activation process.

Paul Rowland
  • 8,244
  • 12
  • 55
  • 76
TheWebs
  • 12,470
  • 30
  • 107
  • 211

3 Answers3

1

deploy >> set break point >> attach process to debugger then goto site action >> site settings >> manager site features >> deactivate feature and then activate it again.

Raheel
  • 595
  • 8
  • 21
1

You can add the line to your code:

System.Diagnostics.Debugger.Launch();

Once the feature is activated, you will see Debug popup dialog and connect to the process.

Paul Rowland
  • 8,244
  • 12
  • 55
  • 76
Igor
  • 19
  • 2
1

Yes it is.

  1. Disable auto-activation at deploy time : Your SharePoint project > Properties > SharePoint > "Current deployement configuration" > Set "none"
  2. Deploy
  3. Attach the debugger : Debug > Attach process > select w3wp.exe
  4. Set some breakpoints
  5. Activate manually your feature : Site Settings > Site collection feature (if the feature's scope is site)
lildadou
  • 46
  • 2