Castle ActiveRecord:SessionScope.Current 在 IIS 7 下为空
我将 ASP.Net MVC(目前仍为 1.0)与 Castle ActiveRecord 和 NHibernate.Linq 一起使用。在 IIS 6 下一切都很好。
但是,我在将应用程序部署到 IIS 7 时遇到了问题:ActiveRecord 的 SessionScope.Current 似乎由于某种原因不可用。
有什么想法吗?
I'm using ASP.Net MVC (still 1.0 for now) with Castle ActiveRecord and NHibernate.Linq. All is fine under IIS 6.
However, I'm faced with a problem deploying my app to IIS 7: ActiveRecord's SessionScope.Current seems to be not available for some reason.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了在 IIS7 及更早版本上使用相同的 web.config 文件,请将 SessionScopeWebModule 放在如下部分中:
除了原始
部分设置之外:请确保设置
部分中的
。In order to use the same web.config file on IIS7 and older versions, put the SessionScopeWebModule in the section like this:
in addition to the original
<system.web>
section settings:Make sure you set the
<validation validateIntegratedModeConfiguration="false"/>
in the<system.webServer>
section as well.如果您使用的是 IIS 7 集成模式,则需要在 system.webServer/modules 部分而不是 system.web/httpModules 中注册 ActiveRecord HttpModule
请参阅
If you're using IIS 7 Integrated Mode you need to register the ActiveRecord HttpModule in the system.webServer/modules section instead of system.web/httpModules
See