I am migrating 2 .NET web sites from one Windows 2003 (IIS6) server to another. One of the sites is .NET 2.0 and the other is .NET 3.5. I am using the StateServer mode of ASP.NET session state with the following settings in the global web.config file (in the C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\ directory). The session state is working fine on the old server.
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424"/>
However, after installing .NET 2.0 and the .NET 3.5 SP1 framework from here, I am getting the following error message the first time (every time) after a server restart, session timeout, or application pool refresh.
Unable to use session state server because this version of ASP.NET requires session state server version 2.0 or above.[ at System.Web.SessionState.OutOfProcSessionStateStore.MakeRequest(StateProtocolVerb verb, String id, StateProtocolExclusive exclusiveAccess, Int32 extraFlags, Int32 timeout, Int32 lockCookie, Byte[] buf, Int32 cb, Int32 networkTimeout, SessionNDMakeRequestResults& results) at System.Web.SessionState.OutOfProcSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ]
I found 2 other posts with similar symptoms, however neither of them provided a solution that worked.
- Unable to use session state server....requires session state server version 2.0 or above.
- Unable to use Session State Server
So far, I have tried:
- Using aspnet_regiis -ua followed by aspnet_regiis -i -enable
- Uninstalling and reinstalling .NET 3.5 SP1 and .NET 2.0
- Explicitly setting the httpRuntime enableVersionHeader attribute to true
Note I have also set up the MachineKey attribute in each application's web.config file as outlined in this MSDN article. This is something I had working on the old server that was copied over exactly the same as it was previously.
I noticed that when I had only .NET 2.0 installed the problem went away completely. It only appeared after I installed .NET 3.5 SP1. Unfortunately, one of the applications depends on .NET 3.5 for some of its functionality so leaving it uninstalled is not an option.
Any ideas how I can diagnose and fix this issue?