Employee Info Starter Kit (v4.0.0) with HttpException

So I wanted to have a look at the new Employee Info Starter Kit. This sample application covers some of the new technology that you can use with ASP.NET Webforms. You can download the sample application here. So I extracted the package, set the correct start up project and started the application. All of a sudden, before the application actually started up, I’m greeted with this exception:

System.Web.HttpException (0×80004005): Session state has created a session id, but cannot save it because the response was already flushed by the application.\r\n   at System.Web.SessionState.SessionIDManager.SaveSessionID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded)\r\n   at System.Web.SessionState.SessionStateModule.CreateSessionId()\r\n   at System.Web.SessionState.SessionStateModule.DelayedGetSessionId()\r\n   at System.Web.SessionState.SessionStateModule.ReleaseStateGetSessionID()\r\n   at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)\r\n   at System.Web.SessionState.SessionStateModule.OnEndRequest(Object source, EventArgs eventArgs)\r\n   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Seems like there is something wrong with the session. Opened up my favourite browser and did some searching. Some minutes later, I had found the solution and here it is..

Open Global.asax and make sure the Session_Start method looks like this:

protected void Session_Start(object sender, EventArgs e)
{
   string sessionId = Session.SessionID;

   if (!Eisk.DataAccessHelpers.ConnectionStringManager.IsConnectionStringOk())
       Response.Redirect("~/public/install.aspx");

}

That should solve the problem! More info can be found here


No comments yet. Be the first.

Leave a reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word