接收'此操作需要IIS集成管道模式。'将httpModule添加到VS Web项目时出错

时间:2021-06-16 04:05:31

Can someone shed some light on what's going on? I have a website created using VS 2010. The following code is added by default by VS when adding an httpModule. When I run the app through Casseni, the highlighted line throws the error "This operation requires IIS integrated pipeline mode."

有人可以了解正在发生的事情吗?我有一个使用VS 2010创建的网站。添加httpModule时,VS默认添加以下代码。当我通过Casseni运行应用程序时,突出显示的行会抛出错误“此操作需要IIS集成管道模式”。

public void Init(HttpApplication context)
    {
        // Below is an example of how you can handle LogRequest event and provide 
        // custom logging implementation for it
       **context.LogRequest += new EventHandler(OnLogRequest);**
    }

    #endregion

    public void OnLogRequest(Object source, EventArgs e)
    {
        //custom logging logic can go here
    }

My web.config file was updated as such:

我的web.config文件已更新如下:

<configuration>  
<system.web>
    <compilation debug="true" targetFramework="4.0" />

  <httpModules>
    <add name="GlobalModule" type="MyApp.Global.GlobalModule, EduCarePro"/>
  </httpModules>

</system.web>

<system.webServer>
<modules>
  <remove name="GlobalModule"/>
  <add name="GlobalModule" type="MyApp.Global.GlobalModule, EduCarePro" preCondition="managedHandler"/>
</modules>
</system.webServer>

Is there something else that must be configured in the Web.Config to prevent this error??

是否还有其他东西必须在Web.Config中配置以防止此错误?

1 个解决方案

#1


1  

The answer to this question is that Visual Studio's development web server does not support this functionality. You must run this code on an a machine running IIS.

这个问题的答案是Visual Studio的开发Web服务器不支持此功能。您必须在运行IIS的计算机上运行此代码。

TAKEN FROM (And Worked for me too as i had same problem)

采取(并为我工作,因为我有同样的问题)

Link

链接

#1


1  

The answer to this question is that Visual Studio's development web server does not support this functionality. You must run this code on an a machine running IIS.

这个问题的答案是Visual Studio的开发Web服务器不支持此功能。您必须在运行IIS的计算机上运行此代码。

TAKEN FROM (And Worked for me too as i had same problem)

采取(并为我工作,因为我有同样的问题)

Link

链接