What's a feasible method of implementing a “tasks” application that runs alongside an ASP.NET MVC site in Medium Trust?

StackOverflow https://stackoverflow.com/questions/3901488

문제

I'm writing an ASP.NET MVC site where I need to have a "Tasks" application that runs alongside the website. Such a "Tasks" application would collect data at set intervals and insert it into the database.

Of course, I could write a simple Console Application and use the Windows Task Scheduler to run it, but my site is being hosted by GoDaddy and I only have medium trust permissions.

Are there any methods for implementing such functionality while not violating medium trust permissions?

One method that I'm considering is a method in the site itself that gathers data, waits for a long time, and then gathers data again. Would that interupt users' connection to the site?

도움이 되었습니까?

해결책

You can do it an ugly way.

Spin-off a thread which keeps on doing the tasks job. Initiate the thread with your own custom website request. The thread will keep running at the back-end.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top