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.

Hi Folks,

I was deploying an asp.net website which configured to store session data in a custom databases in SQL Server 2008. After i scripted the whole DB and moved it to a new server and after deploying the website and try to run the application, I was getting this 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.


My web.config configurations:

 <system.web>
 
      <!-- START: Application is configured to store session data in a custom db , To remove this configuration comment this section and will be InProc default -->
      <sessionState
       mode="SQLServer"
       cookieless="false"
       timeout="20"
       sqlConnectionString="data source=SERVERNAME; initial catalog=MYDB; user id=mostafa; password=mostafaelzoghbi" 
       allowCustomSqlDatabase="true"
      />
      <!-- END: Application is configured to store session data in a custom db , To remove this configuration comment this section and will be InProc default -->
       <!--system.web> 


Since this error message is misleading, you don’t need to run aspnet_regsql command since i was using a custom database and all stored procedures, tables, custom user data types and DB objects have been scripted and deployed too. the cause of this error if you didn’t give enough permission to the user that accesses the database. User should have execute permissions or grant dbo.owner to it.

Hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>