日期:2014-05-17  浏览次数:20426 次

如何注册自定义的httpModule
下面是我写的httpmodule

namespace WebLibrary.Modules
{
    public class MSNModule : IHttpModule
    {
        /// <summary>
        /// You will need to configure this module in the Web.config file of your
        /// web and register it with IIS before being able to use it. For more information
        /// see the following link: http://go.microsoft.com/?linkid=8101007
        /// </summary>
        #region IHttpModule Members

        public void Dispose()
        {
            //clean-up code here.
        }

        public void Init(HttpApplication app)
        {
            app.BeginRequest += app_BeginRequest;
        }

        void app_BeginRequest(object sender, EventArgs e)
        {
          
        }

        #endregion
    }
}


我的asp.net 引用了WebLibrary 这个dll
然后再 跟目录下的webconfig里 如此注册

    <httpModules>
      <add name="MSNModule" type="WebLibrary.Modules.MSNModule"/>
    </httpModules>


但是网站运行时并没有加载我自定义的httpmodule

请教下我的config文件里哪里配置的不对
httpmodule asp.net

------解决方案--------------------
<add name="MSNModule" type="WebLibrary.Modules.MSNModule,WebLibrary"/>
dll名称
------解决方案--------------------
生成网站了吗?
iis版本多少?
如果是7.0
http://technet.microsoft.com/zh-cn/library/cc772059(WS.10).aspx