简体   繁体   English

如何调试IIS 7模块?

[英]How to debug an IIS 7 module?

We had an IIS 7 module that was failing in a rather odd way (to us, at least) - the 32 bit version of the module apparently had some strange behavior where it would look for the 64 bit version of the DLL and use that if it was on a 64 bit machine, rather than the 32 bit version, since we installed the 32 bit version on purpose. 我们有一个IIS 7模块以相当奇怪的方式失败(至少对我们来说) - 该模块的32位版本显然有一些奇怪的行为,它会寻找64位版本的DLL并使用它,如果它是在64位机器上,而不是32位版本,因为我们故意安装了32位版本。

Before we figured this out (read: finally guessed correctly), the behavior the module was exhibiting was "simply not working" - no error message, the module was not writing log files like it normally does (because it wasn't working at all), nothing in the Event Log, nothing in the IIS logs except for an acknowledgement that we had made a POST request to the page exhibiting the non-working behavior. 在我们弄清楚这一点之前(阅读:最后猜对了),模块展示的行为“根本就不起作用” - 没有错误消息,模块没有像通常那样写日志文件(因为它根本没有工作) ),事件日志中没有任何内容,IIS日志中没有任何内容,除了我们已向表示非工作行为的页面发出POST请求的确认。

My question is: to prevent using as huge a chunk of time as we did on this, is there any log file or files where we could have seen that 'such and such a module has failed' or 'XYZ module threw a BadImageFormatException to have given us even a slight clue as to what was going on? 我的问题是:为了防止像我们这样使用大量的时间, 是否有任何日志文件或文件,我们可以看到'这样的模块已经失败'或'XYZ模块抛出BadImageFormatException有给我们甚至一点点关于发生了什么的线索?

Thanks in advance 提前致谢

您可以使用Global.asax Application_Error将Server.Transfer重定向到自定义技术错误页面,该页面将使用GetLastError()显示HttpServerUtility服务器错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM