问题描述
我有在Azure上的ASP.NET Web表单应用程序,但我总是得到一些网站上出现以下错误:
502 - Web服务器,而作为网关或代理服务器时收到了无效响应
I have an ASP.NET Webforms Application on Azure but i always get the following Error on some sites:502 - Web server received an invalid response while acting as a gateway or proxy server.
我已经读了很多关于在Azure上的502错误的话题,但我还是不明白,在我的具体情况是什么问题。
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.
刚刚发生在应用程序的某些网站上的错误。我总是可以复制以下模式:
The error occurs just on some site of the application. I can always reproduce the following pattern:
- 开启SITENAME.azurewebsites.net - >发生错误
- 开启SITENAME.azurewebsites.net/Site1.aspx - >错误不存在的
- 开启SITENAME.azurewebsites.net/Site2.aspx - >错误不存在的
- 刷新SITENAME.azurewebsites.net/Site2.aspx - >发生错误,将不会消失,直到我再打电话Site1.aspx
我在日志中发现的唯一的事情是,应用程序加载System.Windows.Forms.dll程序,并有一个AccessViolationException。我不知道为什么这个DLL文件在所有因为在Visual Studio中的任何项目没有参考加载但那是另一个故事。)
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 :).
但我不明白的是,错误502并不总是在现场502发生。
也许有人可以给我一个提示可能是什么问题或如何我能找到它...
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...
感谢您的帮助!
编辑:
我忘了提:在某些线程关于这个错误我读,这3分钟或类似的东西后发生。在我的情况下,它几乎是送花儿给人大约25秒钟,直到errormessage的显示出来。
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.
推荐答案
这指向一个应用程序的问题。你ETTING 502的原因是,因为工作进程崩溃和前端留给没有响应的请求,并返回502正是这样说的。查找 eventlog.xml
为您的网站LogFiles文件夹下。或者你可以尝试remote从VS调试你的网站。
That points to an application issue. The reason you are etting 502 is because the worker process is crashing and the front end is left with a request with no response and returning a 502 to say exactly that. Look for eventlog.xml
under the LogFiles folder for your website. Alternatively you can try remote debugging from VS to your website.
System.Windows.Forms.dll中
中含有大量的UI code,将最有可能无法正常工作的Azure网站沙箱。它的加载的原因可能是因为你使用的是从组装的东西或使用的东西使用的东西从组装。它没有在Visual Studio中列出被加载,因为它是标准的.NET Framework的一部分
System.Windows.Forms.dll
contains a lot of UI code that will most probably not work Azure websites sandbox. The reason it's loaded is probably because you are using something from the assembly or using something that uses something from that assembly. It doesn't have to be listed in Visual Studio to be loaded since it's a part of the standard .NET Framework.
我会建议寻找到远程调试和在什么时候,这是越来越加载和原因搞清楚。
I would suggest looking into remote debugging and figuring out at what point this is getting loaded and why.
这篇关于Azure的网站错误502的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!