System.Diagnostics.Debugger.Launch(); on Visual Studio C# 2010 Express edition
I have a windows service where I use System.Diagnostics.Debugger.Launch(); to debug the servic开发者_JS百科e. It worked on VS 2010 Pro RC, not on the express edition...
Is there a way to debug a windows service with express edition ?
Thanks in advance
I wasn't aware that you could do that. The way that I normally do it is that I add some command line options to the service, so if it's started as [servicename].exe -c
it starts as a normal executable and then I just set -c as the startup parameter in Visual Studio.
So in my main I've got something similar to this:
if(IsConsole)
ExecuteTheProcess();
else
{
ServiceBase[] servicesToRun = { new MyService(); }
ServiceBase.Run(servicesToRun);
}
精彩评论