如何设置 ASP.NET 应用程序始终运行

发布于 2024-11-03 15:20:23 字数 210 浏览 0 评论 0原文

我有一个 ASP.NET Web 应用程序,即使没有活动会话,我也需要它处于运行状态? 就像现在一样,在最后一个会话结束后,应用程序也结束...

我尝试在 15 分钟后调用回发(因为会话持续 20 分钟); 这里的问题是,在进行回发后,正在运行的会话不知何故没有正确结束,并且只存储新会话; 所以,在它运行大约之后。 1天,突然所有会议都结束了,之后的申请

还有其他意见吗?

I have an ASP.NET web app, and I need it to be in a running state even if there are no sessions alive?
As it is now, after last session is ended, the application is ending as well...

I have tried with invoking postbacks after 15 mins (since sessions are lasting for 20mins);
The problem here is that after doing postback, somehow the running sessions are not properly ended, and only new sessions are stored;
So, after it runs for aprox. 1 day, suddenly all sessions are ending and the applicaiton afterwards

Any other oppinion?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

赢得她心 2024-11-10 15:20:23

下面的帖子解释了如何实现这一点:

Forcing an ASP.NET Application to 'stay alive'

尽管我不建议这样做,因为 ASP.NET 并不是为这种行为而设计的。正如杰克逊·波普(Jackson Pope)建议的那样,您应该尝试寻找另一种解决方案来解决您的问题。

Here is the post that explains how this can be accomplished:

Forcing an ASP.NET Application to 'stay alive'

Although I wouldn't recommend doing so simply because ASP.NET wasn't designed for such behavior. As Jackson Pope suggested, you should try finding another solution to your problem.

秋日私语 2024-11-10 15:20:23

将连续功能分离到 Windows 服务中并将基于会话的 UI 保留为 ASP.Net Web 应用程序/站点可能是有意义的。两者可以使用网络服务或数据库进行对话。

Windows 服务设计为始终运行,也可以设置为在计算机重新启动时运行。

当然,如果您正在考虑远程托管,这将不是一个选择。

It might make sense to separate the continuous functionality into a Windows Service and keep the session based UI as a ASP.Net web app/site. The two can converse using web services or a database.

Windows Services are designed to run all the time, and can be set up to run on machine restart as well.

Of course, if you're looking at remote hosting this won't be an option.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文