While debugging Azure Web Role I have obtained error while Visual Studio debugger was attaching to the emulator.
Here is a good blog which describes hot to diagnose this error:
At the core the issue was:
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
I quickly found out what was the issue. Later to perform some testing I have uninstalled ASP.NET 4 extensions from my IIS and kept just the 3.5 versions (actually 2.0, because 3.5 were just framework extensions). So a quick solution aspnet_regiis.exe -i in 4 version folder will fix it.