AspNetSessionState icon indicating copy to clipboard operation
AspNetSessionState copied to clipboard

InProc throws NRE in 2.0.0

Open mellamokb opened this issue 2 years ago • 2 comments

Just noticed the new version dropped, I get an NRE in the 2.0.0 version due to this line, while using InProcess mode.

var skipKA = config["skipKeepAliveWhenUnused"];

Because config is null in the case of InProc. Simple solution was to add null coalesce operator on the indexing.

mellamokb avatar Jul 13 '23 21:07 mellamokb

To people that is just want to use performance Benefits from this Async Session State Module using InProc, while fix #98 doesn't come as a package version 2.0.0.1, you can just add InProc as a custom provider, so it will not throw a NRE

<sessionState mode="Custom" customProvider="FakeCustomInProc">
  <providers>
    <add name="FakeCustomInProc" skipKeepAliveWhenUnused="false" type="Microsoft.AspNet.SessionState.InProcSessionStateStoreAsync, Microsoft.AspNet.SessionState.SessionStateModule, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </providers>
</sessionState>

eduardo-publi avatar Oct 10 '23 03:10 eduardo-publi

Thank @eduardo-publi, great workaround. Hoping for a release with the hotfix in it though.

kim3er avatar Nov 15 '23 15:11 kim3er