我正在尝试将我的 Visual Studio 2013 asp.net mvc 应用程序配置为将 ncache 提供程序用于会话状态。
到目前为止,我已经添加了对 Alachisoft.NCache.SessionStoreProvider 和 Alachisoft.NCache.Web 的项目引用
我也按照此处找到的步骤进行操作,包括关于 web.config 的第 9 点,现在我的 web.config 中有以下 system.web 部分
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" >
<assemblies>
<add assembly="Alachisoft.NCache.SessionStoreProvider,Version=4.1.0.0,Culture=neutral,PublicKeyToken=CFF5926ED6A53769"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5" />
<sessionState cookieless="false" >
<providers>
<add name="NCacheSessionProvider"
type="Alachisoft.NCacheExpress.Web.SessionState.NSessionStoreProvider"
sessionAppId="NCacheTest"
cacheName="MyClusterCache"
writeExceptionsToEventLog="false"
enableLogs="false"/>
</providers>
</sessionState>
</system.web>
但是,当我调试我的应用程序时,它似乎仍然使用默认的 inproc 会话状态,因为一切正常,但我的缓存显示 0 个对象。
使用 NCache api,我可以将项目添加到缓存中,这会显示在我的 NCache 管理控制台统计信息中。
谁能描述他们是如何设置的或看到我遗漏的任何东西?提前致谢