System.Diagnostics.Debugger.Launch();
It tells Windows to ask if you want to debug the application, and you simply select the running version of Visual Studio and you're in the code.
If you're remote debugging then add this code to the startup of the service and it will make the service wait till you attach to it from Visual Studio (using remote debugging) before continuing...
while (!System.Diagnostics.Debugger.IsAttached) { System.Threading.Thread.Sleep(1000); }
Bosh!
No comments:
Post a Comment