开发者

System.Diagnostics.Debugger.Launch(); on Visual Studio C# 2010 Express edition

开发者 https://www.devze.com 2023-01-05 01:32 出处:网络
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...

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

精彩评论

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