Asp.net 如何确定正在执行哪个IIS模块来设置前提条件?

Asp.net 如何确定正在执行哪个IIS模块来设置前提条件?,asp.net,iis,asp.net-web-api,web-config,Asp.net,Iis,Asp.net Web Api,Web Config,我已经在Web窗体应用程序中添加了Web API <system.webServer> <modules> <remove name="UrlRoutingModule-4.0"/> <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition=""/> </modules> 我不想为它创建单独的

我已经在Web窗体应用程序中添加了Web API

<system.webServer>
  <modules>
    <remove name="UrlRoutingModule-4.0"/>
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition=""/>
  </modules>
我不想为它创建单独的模块。当我向Web API发出请求时,此代码在IIS 7.5(Windows 7)中运行良好。但是,该事件不会在IIS 7.0(Windows Server 2008)中触发

IIS 7模块:

我发现runAllManagedModulesForAllRequests=“true”一切都很好:


但是,我想通过为特定HTTP模块显式设置
predition=”“
来去掉这个参数


我不知道需要添加什么模块。如何找到它?

通过安装修补程序解决了这个问题


我的服务器已安装所有实际的Windows更新。我不认为我需要修补程序。

谢谢,这也解决了我们的问题。花了数小时查看我们的Windows Server 2008 IIS 7设备和开发Windows Server 2008 R2 IIS 7.5设备之间的IIS和网站配置差异
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
    ' Fires at the beginning of each request
End Sub
<system.webServer>
  <modules runAllManagedModulesForAllRequests="true">
    <remove name="UrlRoutingModule-4.0"/>
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition=""/>
  </modules>