lusio
lusio

Reputation: 11

mvc 4 + iis7.5 application stop

It's the first time that I write here so I hope to be very clear ! I've a deployed mvc application on iis 7.5. In the application_start it starts to do some operation like download files on a fixed interval. I've access to windows server 2008 by remote desktop on a virtual machine. The problem is that when I logout from this virtual machine, the application seems to stop and it is not downloading anymore anything 'till I don't start once another time the application.

Is it normal or do I've some kind of problem in my configuration ?

I want that the application start just one time and cycle that kind of operations without stops..

Upvotes: 1

Views: 1572

Answers (2)

Kenneth Ito
Kenneth Ito

Reputation: 5261

On default application pool settings, this is normal (assuming you have low traffic to your site). The app pool will shutdown after a set inactivity period and take your downloader offline with it. I believe the default is 20 minutes of inactivity.

Here's some info on configuring the timeout. http://technet.microsoft.com/en-us/library/cc771956(v=ws.10).aspx

And here's some info about configuring IIS to auto start and always run (to somewhat emulate a windows service environment) http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx

Here are some of the risks and workarounds associated with running long running processes under asp.net http://haacked.com/archive/2011/10/16/the-dangers-of-implementing-recurring-background-tasks-in-asp-net.aspx

Upvotes: 1

RredCat
RredCat

Reputation: 5421

To my mind it isn't good idea to implement downloading in application_start (Check more there about lifetime in asp.net). You need to implement some kind of service for this purpose. Could you specify your target for detailed answer?

Upvotes: 0

Related Questions