开发者

LazyInitializationException after upgrade to IIS 7.5

We develop a ASP.NET 4.0 / MVC 3 web application, using Active Record as database abstraction.

To be able to use lazy relations inside views, we are using the SessionScopeWebModule from ActiveRecord documentation here.

The app works fine on our current Win 2003 / IIS 6 machine, but only on our new Win 2008 R2 / IIS 7.5 开发者_如何转开发it throws a LazyInitializationException when a controller or view tries to access a lazy relation. After changing to manual session handling (also explained in the doc link above), it works again.

I wonder what the difference is, as the manual states that both approaches do basically the same thing.


When running an ASP.NET app in IIS 7+ in integrated pipeline, you need to register the http modules under the system.webServer / modules section of web.config.

It's possible to have a single web.config for both IIS 6 and IIS 7+, see this article.

Otherwise, run in classic pipeline mode, it will behave just as in IIS 6.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜