IIS自定义会话商店提供商RedissessionStateProvider(REDIS会话状态)找不到

发布于 2025-01-27 11:04:47 字数 785 浏览 5 评论 0原文

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

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

发布评论

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

评论(1

薄暮涼年 2025-02-03 11:04:47

谢谢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.

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