'IIS custom session state store provider RedisSessionStateProvider is not found (Redis Session State)

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.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source