Tuesday, October 26, 2010

Problem with SQL 2008 based ASP.NET 2.0 state management (Update 2)

…and one more: configuration of ASPState succeeded using

aspnet_regsql –ssadd –sstype p –E –S .

(s. also Problems with SQL based ASP.NET state management ).

The Web Appication still reports an error:

Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above.
at System.Web.SessionState.SqlSessionStateStore.SqlPartitionInfo.GetServerSupportOptions(SqlConnection sqlConnection)
at System.Web.SessionState.SqlSessionStateStore.SqlPartitionInfo.InitSqlInfo(SqlConnection sqlConnection)
at System.Web.SessionState.SqlSessionStateStore.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo)
at System.Web.SessionState.SqlSessionStateStore.GetConnection(String id, Boolean& usePooling)
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context, String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags)
at System.Web.SessionState.SqlSessionStateStore.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags)
at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

The database (usually named ASPState) may be installed on the used SQL Server instance, the Web Application pool account may have granted connect, dataread and datawrite privileges, but the error comes over and over again.

Thereason is mostly, the Web Application pool account is missing some execution permissions on the  ASPState objects like store procedures.
image

You can either

  • grant to the Web Application pool account execute permission to each store procedure listed above
    or
  • alternatively grant to this account db_owner role (it includes execution permissions to mentioned stored procedures).

Enjoy!

No comments: