Castle ActiveRecord:SessionScope.Current 在 IIS 7 下为空

发布于 2024-08-27 08:42:26 字数 191 浏览 10 评论 0原文

我将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

难忘№最初的完美 2024-09-03 08:42:26

为了在 IIS7 及更早版本上使用相同的 web.config 文件,请将 SessionScopeWebModule 放在如下部分中:

<configuration>
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
         <add name="ar.sessionscope" type="Castle.ActiveRecord.Framework.SessionScopeWebModule, Castle.ActiveRecord" />

除了原始 部分设置之外:

<configuration>
   <system.web>
      <httpModules>
              <add name="ar.sessionscope" type="Castle.ActiveRecord.Framework.SessionScopeWebModule, Castle.ActiveRecord" />

请确保设置 部分中的

In order to use the same web.config file on IIS7 and older versions, put the SessionScopeWebModule in the section like this:

<configuration>
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
         <add name="ar.sessionscope" type="Castle.ActiveRecord.Framework.SessionScopeWebModule, Castle.ActiveRecord" />

in addition to the original <system.web> section settings:

<configuration>
   <system.web>
      <httpModules>
              <add name="ar.sessionscope" type="Castle.ActiveRecord.Framework.SessionScopeWebModule, Castle.ActiveRecord" />

Make sure you set the <validation validateIntegratedModeConfiguration="false"/> in the <system.webServer> section as well.

独行侠 2024-09-03 08:42:26

如果您使用的是 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文