httpModules not working on iis7

ⅰ亾dé卋堺 提交于 2019-11-29 05:40:48
Ben Robinson

On IIS7 and higher use

<configuration>
  <system.webServer>
    <modules>
      <add name="CustomModule" type="Samples.CustomModule" />
    </modules>
  </system.webServer>
</configuration>

Above is correct for IIS 7.5

<modules>
  <add name="CustomModule" type="Samples.CustomModule" />
</modules>

the only problem I got, is that instance of application pool for particular application should be set to managed Pipeline = Integrated, not Classic..
or: Using Classic Mode

If your application is to use Classic mode, then make sure that your application is configured for that type of pool and your modules are configured in system.web section and not in system.webServer section of web.config file.

Rissa

In IIS go to feature view select module

double click to module then right click and press (Add Managed Module)

then put name and type as defined in web.config

example:

<httpModules>
  <add name="CustomModule" type="WebApplication.Security.CustomModule" />
</httpModules>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!