开发者

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);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜