Daniel Leiszen
Daniel Leiszen

Reputation: 1897

Visual Studio 2013 debug session stops 1 minute after logging in with AspNet Identity

Maybe the answer is trivial, but I couldn't find the exact same behavior in other threads. I have an MVC 5 web application. I implemented custom identity database with Asp.Net Identity 2 (Owin). I have only external login (facebook, google...etc). The login works fine. The users got authenticated with roles and everything.

After one minute of inactivity, my Visual Studio 2013 debug session stops. Sometimes the application remains available (so IIS App Pool is not stopped) sometimes it recycles IIS as well.

I also implemented logging in Application_End Global.asax method in order to have the shutdown reason, but in these cases there is no info in the logs. In other cases, when the App pool is recycled due to web.config change I do have info in the logs.

I suspect timeout, however I have no clue what kind of timeout it could be. Where should I look?

Thanks in advance.

Upvotes: 1

Views: 1953

Answers (3)

Aaron Myhr
Aaron Myhr

Reputation: 1

Daniel I have had this exact same issue for a few months now and was about to go crazy about it. But I stumbled on a suggestion to run visual studio as administrator and that seems to have worked.

Upvotes: 0

Arjan Einbu
Arjan Einbu

Reputation: 13672

I ran into the same problem, and found out how to set the timeout for IIS Express:

On the command window, navigate to the folder where IIS Express is installed, and execute the following appcmd command:

c:\Program Files (x86)\IIS Express> appcmd set config /section:applicationPools /[name='Clr4IntegratedAppPool'].processModel.idleTimeout:0.00:00:00

(scroll right to see the whole line)

Upvotes: 4

demoncodemonkey
demoncodemonkey

Reputation: 11957

Open IIS, find your application's AppPool, then:

  1. Right click on the app pool and select Advanced Settings
  2. Under "Process Model" set Idle Time-Out (minutes) to 0.

For reference, the only non-default (non-bold) settings in my "Process Model" and "Recycling" section are:

Identity : NetworkService
Idle Time-out (minutes) : 0
Ping Enabled : False

And with these settings, I can start up the debugger and it never seems to automatically time out or recycle.

Upvotes: 2

Related Questions