需要建议用不可见的WinForm应用程序替换Windows Service [英] Need suggestion on replacing Windows Service by invisible WinForm Application

查看:148
本文介绍了需要建议用不可见的WinForm应用程序替换Windows Service的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个后台应用程序来支持我的客户端应用程序,无论主客户端应用程序是否运行,该后台应用程序都应始终在客户端计算机上运行.

I need a background application to support my client application, which should always run on the client machine regardless of the main client application is running or not.

Windows Service是我的首选,但是我遇到Windows Service时遇到的问题是:可以通过主要客户端应用程序轻松控制Windows Service,发布和安装Windows Service修补程序以及在Windows Service无法运行时进行故障排除.

Windows Service was my first choice but problems I faced with Windows Service were: ease of control over windows service through main client application, release and installation of patches to the windows service and troubleshooting if windows service fails to run.

因此,我开始考虑Windows Service的替代方案,发现没有可见表单的Windows Forms应用程序可以为我做这件事.这个不可见的应用程序应从系统启动开始,并始终保持运行,完成Windows Service会执行的所有工作.但是在深入研究开发之前,我想探讨一下这种方法的利弊.

So, I started thinking for alternatives to the Windows Service and found that a Windows Forms application with NO visible forms can do it for me. This invisible app should start with system startup and keep running all the time, doing all the work that a Windows Service would do. But before I go deeper into the development, I want to explore the pros and cons of this approach.

对此方法有何建议/评论?

Any suggestions/comments on this approach?

推荐答案

您的要求更适合Windows服务. Windows服务的主要优点是,无论系统是否有人登录,它都会在系统启动后立即启动.

Your requirements are more suited for windows service. Main advantage with windows service is that it will start as soon as system comes up, irrespective of anybody is logged into system or not.

要解决部署问题,请将业务逻辑构建到单独的程序集中,并使用Windows服务调用必要的功能.这样,您可以仅部署修改后的程序集.

To sort out deployment issues, you build your business logic into separate assembly and call the necessary function withing windows service. This way you can deploy just the modified assembly.

具有不可见形式的Winform应用程序将无法达到目的. HTH

Winform application with invisible form will not serve the purpose. HTH

这篇关于需要建议用不可见的WinForm应用程序替换Windows Service的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆