title: Azure Website Error 502
body: <p>I have an ASP.NET Webforms Application on Azure but i always get the following Error on some sites:
  <strong>502 - Web server received an invalid response while acting as a gateway or proxy server.</strong></p>
  
  <p>I already read a lot of topics regarding the 502 error on Azure but i still don't understand what the problem in my particular situation is.</p>
  
  <p>The error occurs just on some site of the application. I can always reproduce the following pattern:</p>
  
  <ul>
  <li>Open SITENAME.azurewebsites.net                  -> Error occurs</li>
  <li>Open SITENAME.azurewebsites.net/Site1.aspx       -> Error not occuring</li>
  <li>Open SITENAME.azurewebsites.net/Site2.aspx       -> Error not occuring</li>
  <li>Refresh SITENAME.azurewebsites.net/Site2.aspx    -> Error occurs and won't go away until i call Site1.aspx again</li>
  </ul>
  
  <p>The only thing i found in the log is, that the application loads System.Windows.Forms.dll and there is an AccessViolationException. I have no idea why this dll is loaded at all because there is no Reference in any Project in Visual Studio to it but thats another story :).</p>
  
  <p>But what i don't understand is that the error 502 does not always occur on Site 502.
  Maybe someone can give me a hint what might be the problem or how i could find it...</p>
  
  <p>Thanks for your help!</p>
  
  <p><strong>EDIT:</strong>
  What i forgot to mention: In some threads regarding this error i read, that it occurs after 3 minutes or something like that. In my case it is nearly alway about 25 seconds until the errormessage shows up.</p>