3
我跟着這篇文章:事件處理程序只能在IHttpModule初始化期間綁定到HttpApplication事件。
Effective NHibernate Session management for web apps
但這:
public void Dispose()
{
app.BeginRequest -= ContextBeginRequest;
app.EndRequest -= ContextEndRequest;
}
回到我這個錯誤:
Event handlers can only be bound to HttpApplication events during IHttpModule initialization.
爲什麼?我可以忽略這些Dispose
聲明嗎?