Provider must implement the class 'System.Web.SessionState.SessionStateStoreProviderBase'

1.3k Views Asked by At

I'm trying to integrat a .net 4.6.2 MVC application that is hosted in an Azure App Service with Redis Session State.

I have installed the packages via nuget and have the following items added into the web.config

<sessionState mode="Custom" customProvider="MySessionStateStore">
  <providers>
    <add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="host-name" accessKey="access-key" ssl="true" />
  </providers>   
</sessionState>

The following module has been added as per Google result answers...

<system.webServer>
  <modules>
    <remove name="Session" />
    <add name="Session" type="Microsoft.AspNet.SessionState.SessionStateModuleAsync, Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode" />
  </modules>
</system.webServer>

I'm still getting a configuration error saying that the Provider must implement the class 'System.Web.SessionState.SessionStateStoreProviderBase' and I can't see what else is missing.

The web.config is being transformed during the deployment of the package via Octopus Deploy but can't see any issues with the resulting configuration.

Does anyone have any ideas on how to resolve this?

Thanks

1

There are 1 best solutions below

0
Amit On

I faced a similar issue in our implementation when only SSL was enabled. After switching to non-SSL port it started working. I'm not sure why it worked that way. If you have an option to use non-SSL port, you may as well give it a try

Also make sure you add this entry in your config under

<modules>
<remove name="Session" />
<add name="Session" type="Microsoft.AspNet.SessionState.SessionStateModuleAsync,Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode" />