Controller actions hit multiple times - ASP.NET MVC 4 App running in Azure Emulator

后端 未结 1 552
长发绾君心
长发绾君心 2021-02-16 00:03

This might take some time to explain, but here I go :).

I created two Visual Studio 2012 projects:

  1. A project using the (Web -> ASP.NET MVC 4 Web Applicatio
1条回答
  •  滥情空心
    2021-02-16 00:33

    So based on what I wrote in the various edits of the original post:

    • On my machine at least, the DevFC.exe process (development fabric, Azure compute emulator) is sometimes spawning multiple requests for the requested resource from IIS Express. That is, it'll take a single request on the emulator endpoint, and sometimes spawn multiple requests to the underlying IIS Express application, one after another, even though they all succeed with HTTP status code 200. The time difference between these spawned requests seems to be constant, but aside from that, the behavior seems non-deterministic (i.e. it doesn't happen for every request to the emulator endpoint).
    • In order to debug this, I'd need access to the source code of the Azure compute emulator, which I'm guessing I can't get.

    Now, my theory (and hope) is that this behavior is somehow specific to my development environment and won't be reproducible on the real Azure infrastructure. That said, I have come up with a workaround...

    I created a simple proxy file for Firefox to redirect all traffic going to my local Azure emulator port to the IIS Express application port. This solves the problem, however I'm aware that I'm essentially bypassing the Azure emulator now, and I'm guessing I may have issues in the future because I'm doing that (e.g. if I decide to use the AppFabric cache?)!

    In the mean-time I'll continue with this workaround for development and periodically deploy to my Azure staging environment for testing there.

    Regardless, if anybody knows how I might solve the fundamental problem, let me know! :)

    EDIT: I am no longer able to reproduce the issue using version 2.2 of the Azure SDK Tools. If you're still seeing this behaviour, try upgrading!

    0 讨论(0)
提交回复
热议问题