How to implement background processing for ASP.Net MVC website in a shared hosting environment?

て烟熏妆下的殇ゞ 提交于 2019-12-02 18:24:22

Have you tried with quartz.net? I think it may fit your needs.

also take a look at this Simulate a Windows Service using ASP.NET to run scheduled jobs article.

it explains a nice way to schedule operations with no outer dependence.

The idea is to use Cache timeout to control the schedule. I've implemented it successfully on a project which required regular temp file cleaning. This cleaning is a bit heavy so we move this clean operation in a scheduled job (using the asp.net cache) to avoid having to deploy scheduled task or custom program.

To answer whether GoDaddy will support a seperate service you need to ask them.

However there are a number of creative ways that you can "get around" this issue on shared hosting.

  1. Have a secure page that's purpose is to execute your background work. You could have scheduled task on a machine under your control that calls to this web page at set intervals.
  2. Use a variation of the Background Worker Thread answer from @safi. Your background worker thread could check to see if another is already processing and stop, so that only one instance is running at a time.

If only one background task is enough for you then use the WebBackgrounder And this is the article with detailed explanation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!