在 Windows Server 启动时自动运行程序 [英] Automatically run program on Windows Server startup

查看:93
本文介绍了在 Windows Server 启动时自动运行程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在始终运行的 Windows 服务器上创建和安装 .NET 应用程序,但遇到了问题.我听说我不应该让它成为 Windows 服务(我个人宁愿拥有一个对话框应用程序,以便我可以看到进度等),所以我正在尝试使用任务调度程序.但是,任务调度程序一直试图过早关闭我的应用程序,而此时它应该只打开它并保持打开状态.

I am trying to create and install a .NET app on a windows server that is always on, but I am running into problems. I have heard that I should not make it a Windows service (and would personally rather have a dialog app so I can see progress, etc) so I am trying to use the task scheduler. However, the task scheduler keeps trying to close my app prematurely, when it should only open it and leave it open.

有什么想法可以让我的对话应用程序在我的服务器上启动(并保持运行)吗?

Any ideas how I could have my dialog app run on startup (and stay running) on my server?

推荐答案

你应该制作一个 Windows 服务;这是唯一可靠的方法.
否则,您会遇到问题,例如,用户注销.

You should make a Windows Service; it's the only reliable way to do this.
Otherwise, you will run into problems if, for example, the user logs off.

如果你想要 UI,你可以制作一个单独的 GUI 来与服务通信(可能使用 WCF).

If you want UI, you can make a separate GUI that communicates with the service (probably using WCF).

这篇关于在 Windows Server 启动时自动运行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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