IIS自定义会话商店提供商RedissessionStateProvider(REDIS会话状态)找不到
我在Windows Server 2019上的IIS中运行了一个.NET Web应用程序。 Microsoft.web.redissessionStateProvider软件包安装在我的Visual Studio中的解决方案中。在Web服务器上部署该应用程序后,我现在在启动网页时会看到以下错误:
找不到自定义会话state Store商店提供商“ redissessionStateProvider”。
web.config包含以下内容:
<sessionState mode="Custom" customProvider="RedisSessionStateProvider" cookieless="UseCookies" cookieName="__Host-MyApp" timeout="60">
<providers>
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="192.168.0.26" port="6379" accessKey="" ssl="false" />
</providers>
</sessionState>
我可以在网站的 /bin文件夹中看到microsoft.web.web.web.web.web.web.web.web.web.web.web.web.web.web.web.web.web.web.web。我可以使用Redis-CLI从Web服务器连接到Redis服务器。
I have a .NET web app running in IIS on Windows Server 2019. I've recently switched from InProc session state to Redis (custom). The Microsoft.Web.RedisSessionStateProvider package is installed in my solution in Visual Studio. After deploying the app on a web server, I'm seeing the following error when launching the webpage now:
The custom session state store provider 'RedisSessionStateProvider' is not found.
The Web.config contains the following:
<sessionState mode="Custom" customProvider="RedisSessionStateProvider" cookieless="UseCookies" cookieName="__Host-MyApp" timeout="60">
<providers>
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="192.168.0.26" port="6379" accessKey="" ssl="false" />
</providers>
</sessionState>
I can see the Microsoft.Web.RedisSessionStateProvider.dll (and .pdb) in the /bin folder of the site. I can connect to the Redis server from the Web Server using the Redis-cli.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谢谢Jennydai。
我的.NET应用程序解决方案(.sln)已包含Redis会话提供商,现在可以连接到REDIS服务器。
在Visual Studio 2022中,打开解决方案(.sln),然后转到工具&GT; Nuget Package Manager&gt;管理用于解决方案的Nuget软件包,然后添加“ Microsoft.Web.ServissessionStateProvider”和任何依赖项。注意,您需要的版本取决于.NET框架版本。
Thanks JennyDai.
The Redis session provider has been included with my .NET app solution (.sln) and I can now connect to the Redis server.
In Visual Studio 2022, open your solution (.sln) and go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution and add "Micrsoft.Web.RedisSessionStateProvider" and any dependencies. Note, the version you need depends on your .Net Framework version.