我断断续续地注意到这一点。如果我在 Visual Studio 2013 中本地调试我的 Azure WebRole,并且我在断点处暂停的时间过长,则当前请求或下一个请求以及所有后续请求将导致 500.19 - 内部服务器错误.
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module CustomErrorModule
Notification SendResponse
Handler Not yet determined
Error Code 0x80070490
Config Error The configuration section 'system.webServer/httpErrors' cannot be read because it is missing a section declaration
Config File \\?\C:\Users\<user>\AppData\Local\dftmp\Resources\11468ba0-d99a-45d2-bcce-eae28c7b4e2f\temp\temp\RoleTemp\applicationHost.config
Requested URL <request url>
Physical Path
Logon Method Not yet determined
Logon User Not yet determined
事件查看器说:
The worker process for application pool '902aa9af-0ed8-4126-be43-e533339bdeef' encountered an error 'Cannot read configuration file' trying to read global
module configuration data from file '\\?\C:\Users\<user>\AppData\Local\dftmp\Resources\11468ba0-d99a-45d2-bcce-eae28c7b4e2f\temp\temp\RoleTemp\applicationHost.config',
line number '0'. Worker process startup aborted.
如果我去检查那个目录,我会发现该文件不存在。我猜文件在某个时候就在那里,因为我能够在此之前提出请求。
重新启动 WebRole 似乎可以解决问题。
99% 的情况下这不是问题,所以我确信配置文件中实际上没有错误,它只是让调试“压力”,因为我总是觉得自己处于某种时间限制之下. :(