AspNetSessionState
AspNetSessionState copied to clipboard
InProc throws NRE in 2.0.0
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.
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>
Thank @eduardo-publi, great workaround. Hoping for a release with the hotfix in it though.