There are times where you just can’t manually attach the Visual Studio debugger to your code. Like when you’re trying to debug Sharepoint feature events (FeatureActivated, FeatureDeactivating, etc.) when Visual Studio is deploying your SharePoint project.
For those situations you can use this line of code to attach Visual Studio to your process.
System.Diagnostics.Debugger.Launch();
Just make sure to remove it before you ship your software.
Nice tip Justin. I've had hit or miss issues trying to debug certain things like that. Thanks!
ReplyDeleteHappy to help Dan. When all else fails, I drop to that old stand by.
Deleteit takes too long time :(
ReplyDelete