托管 C# Windows 服务或在共享托管环境中运行连续任务的替代方案
我的应用程序需要在没有任何用户干预的情况下运行连续任务,但我发现如何将其作为 Windows 服务托管在共享虚拟服务器上很困难,因为这些控制面板仅提供对 IIS 的访问。
我的问题是实现这一目标的方法是什么,或者在共享托管服务器上运行连续任务的替代方法是什么?
我不考虑专用服务器,因为那太贵了..
谢谢
My application required to run continuous tasks without any user intervention but I am finding difficult how to host it on shared virtual server as a windows service, because those control panels are only providing access to IIS.
My questions is what will be way to achieve this goal or alternative to run continuous task on shared hosted server?
I am not thinking for dedicated server because that is too costly..
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能在您的案例中定义“连续”吗?
由于您无法访问物理盒子(甚至无法完全访问虚拟盒子),因此您的选择有点有限。
您可以拥有一个以某种方式保持活动状态的 ASP.NET 应用程序(大多数共享托管环境在没有请求时会回收,但有一些方法可以解决这个问题),并在后台的计时器上运行一个进程。我们之前已经通过网站的一些清理任务完成了这一点。
但如果你需要比这更连续的东西......我不知道。我认为您要么需要获得对某个盒子的完全访问权限,以便安装您的服务,要么改变您的服务运行方式的想法。
Can you define "continuous" in your case?
Since you can't get access to a physical box (or even full access to a virtual box), your options are kind of limited.
You could have an ASP.NET application that is kept alive somehow (most shared hosting environment will recycle when there aren't requests, but there are ways around that) that runs a process on a timer in the background. We've done this with some cleanup tasks for sites before.
But if you need something more continuous than that... I don't know. I think you're either going to need to get full access to a box so you can install your service, or change the idea of how your service runs.