7

I'm having trouble with real time debugging of a Windows service on a remote machine. This machine is behind a firewall only accessible through remote desktop. I include Debug.WriteLine statements through my code, in lieu of Console.WriteLine. Not too long ago I ran across an application from Microsoft named Debug View. It has been helpful in debugging Forms and WPF applications but it will not show the Debug.WriteLine statements for a running service. I would be extremely happy if I could see these debug statements. Is there a way to do this?

Note, the project is compiled in debug mode as I can see the debug statements in Debug View during the service installation.

4

1 回答 1

12

Run Debug Viewas Administrator,选择Capture菜单,然后确保Capture Global Win32已选中。这将捕获Debug.WriteLine您的服务(以及任何其他服务)的输出。您可能希望使用过滤器来防止Debug View显示您不感兴趣的输出。考虑在您的服务调试消息前加上您的服务名称,以便您可以过滤它们。

于 2013-05-24T13:34:18.167 回答