Can't get azure web role to run locally using

2020-08-22 09:51发布

问题:

I have a web role that I'm trying to run locally using the emulator. I have it working on another computer, but I cannot get it working on a different one, and have gone as far as to reformat it and start from scratch.

When I launch the site from Visual Studio, Chrome shows the following message:

This webpage is not available

The connection to 127.0.0.1 was interrupted.

There is also an error code listed at the bottom:

Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.

One interesting thing from the build output are these lines:

Starting process 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\v1.8\Debugger\WindowsAzureDebugger.exe' with arguments '"C:\Program Files\IIS Express\iisexpress.exe" /trace:error /config:"C:\Users\brian\AppData\Local\dftmp\Resources\159c7254-b7d0-4076-a4fd-820b00feca5f\temp\temp\RoleTemp\applicationHost.config" /site:"deployment18(27).AzureApp.MyApp.Web_IN_0_Web"'...

Process 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\v1.8\Debugger\WindowsAzureDebugger.exe' exited with exit code 0.

If I run C:\Program Files\IIS Express\iisexpress.exe" /trace:error /config:"C:\Users\brian\AppData\Local\dftmp\Resources\159c7254-b7d0-4076-a4fd-820b00feca5f\temp\temp\RoleTemp\applicationHost.config" /site:"deployment18(27).AzureApp.MyApp.Web_IN_0_Web" from the command line, I get the following message:

The system cannot find the file specified. Unable to start IIS Express in background.

I have no idea what file it cannot find, but I've verified that the config file I'm passing does in fact exist. Anyone have a clue what's going on here??

回答1:

While I can not tell you what could be the actual root cause of your problem I can suggest a few ways to troubleshoot it:

  1. Try changing IIS Express to Full IIS and see if it changes the behavior. You can do it by going to your Windows Azure Application project properties and look at "Web" option.
  2. Try running application without debugging it
  3. Launch CSrun at command prompt with /launchDebugger parameter of the /run option to verify that debugger does run without any issue
  4. Try using IE as default browser
  5. Clean your dftemp folder completely for any residual configuration and then launch Azure Emulator separately to verify there are no issues


回答2:

Procmon "http://technet.microsoft.com/en-us/sysinternals/bb896645" may help you find the file that is missing...



回答3:

Hopefully someone stumbles upon this answer with similar symptoms. When removing in role caching the <dataCacheClients> section was removed from . Somehow there was a left over <dataCacheClients> section left in the web.config. Everything and compiled and deployed to the emulator successfully. However, the role would fail to start since applicationHost.config was missing. The fix was simply remove the unnecessary <dataCacheClients> section from the web.config file.