Azure Web Role recycling

On one machine, there was an error that didn’t reproduce on other devices.
Web Role can’t start in debug mode with recycling issue.

capture

First of all I checked EmulatorRuntime.log which located in “C:\Users\<user>\AppData\Local\dftmp\EmulatorRuntimeLogs”.

There was a message:

I spend a lot of time trying to fix this issue. Helpful links from stackoverflow.com:

But no one of this solutions solved my problem.

The problem was: Startup Task in ServiceDefinition.csdef made my role recycle.

Solution: So if you have problem with recycling check your startup tasks.

Asp.Net vNext and static files

If you start working with Asp.Net vNext Empty project and need static files, don’t forget:

  • Add reference Microsoft.AspNet.StaticFiles to project.json file into dependencies section
  • Append code provided below to Startup.cs: