Search code examples
asp.netazureazure-web-roles

Debugging on Windows Azure SDK 1.8 Emulator on Windows 8 does not work


Whenever I hit debug in Visual Studio, it deploys the website into IIS / Compute Emulator and gives the following message:

There was an error attaching the debugger to the IIS worker process for URL 'http://127.255.0.0:82/' for role instance 'deployment18(521).TestApp.Azure.Website1.Web.UI_IN_0'. Unable to start debugging on the web server. Could not start ASP.NET debugging. More information may be available by starting the project without debugging.

Then when I look at the debugger log it says:

http://127.255.0.0:82/debugattach.aspx
----------------------------------------------------------------------
Status code=417 (Expectation Failed)
Protocol version=1.1
Cached=False
Content-Length=60
Cache-Control=private, no-transform
Content-Type=text/html
Date=Thu, 08 Nov 2012 14:52:08 GMT
----------------------------------------------------------------------
The page cannot be displayed because the expectation failed.

Does anyone have any ideas?


Solution

  • After using Failed Request Tracing I was able to see that my Application Initialization (Web-AppInit) (the new initialization feature in IIS 8.0) configuration was making the debugging fail.

    So the message is: don't expect to be able to debug your web application if you have preloadEnabled and an applicationInitialization config section a bit like this:

     <applicationInitialization doAppInitAfterRestart="true" remapManagedRequestsTo="loading.html" skipManagedModules="true">
          <add initializationPage="/" />
        </applicationInitialization>
    

    I will be putting this into the web.release.config file so it only takes effect in production.