最简单的开发/调试Windows服务的方法 [英] Easiest way to develop/debug a Windows service
问题描述
什么是最好的方式做一个Windows的常规调试正在开发的服务我考虑过的一个选择是将我的所有逻辑转移到一个DLL项目中,仅在服务本身中保留控制逻辑,然后创建一个基本上只有开始和停止按钮的Forms项目,并调用该DLL做其他事情。这样,我可以正常调试我的代码,然后在DLL准备就绪时部署编译的服务。
这是否有意义?我可以使用任何可用的解决方法。 PB的建议这里听起来像我'请问 - 有人使用这种方法吗?
Debugger.Break()
:)
I'm developing a Windows Service in VB.NET 2008, but I feel like I'm going to have an aneurysm. To debug the service, I've added a 15 second wait to the initialization code, which gives me time to start the service and attach the .NET debugger before anything happens, so I can hit breakpoints and such. I really miss "integrated" debugging with this type of workaround, and testing seems to be a huge pain.
What's the best way to do "regular" debugging of a Windows Service that's in development? One option I'd considered was moving all of my logic to a DLL project, leaving only control logic in the service itself, and then creating a Forms project that essentially just had "start" and "stop" buttons on it, and called into the DLL to do everything else. This way, I can debug my code normally, and then just deploy the compiled service when the DLLs are ready.
Does this make sense/annoy others? I'm open to any workarounds available. PB's suggestion here sounds like what I'm asking - has anybody used this approach?
Debugger.Break()
:)
这篇关于最简单的开发/调试Windows服务的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!