none
2.0 Session State in SQL 2008 R2 Not recognized as 2.0

    Question

  • I am creating a session state database in SQL Server 2008 R2 by doing this in command prompt:

    cd c:\windows\microsoft.net\framework64\v2.0.50727
    aspnet_regsql -S .\MyInstance -E -ssadd -sstype p

    The ASPState datebase is created without a hitch.  I am using the following in the config file, as always in SqlServer 2005:

    <sessionState mode="SQLServer" cookieless="UseCookies" sqlConnectionString="data source=.\MyInstance;Integrated Security=SSPI" timeout="20" />

    But I am getting the following error when starting the app

    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.

    What am I doing wrong?

    Javed

    • Moved by Bob Beauchemin Saturday, February 19, 2011 6:43 PM Moved to a slightly more relevent forum. Really should be reposted to ASP.NET forums (From:.NET Framework inside SQL Server)
    Saturday, February 19, 2011 6:14 PM

Answers

  • Thanks Dan,

    I do have a login and a user account for NT AUTHORITY\NETWORK SERVICE.  Now when using SQL 2005 I have never had to grant any permissions and I haven't done that here.

    The error message appears to imply that even the ASPState database is not being discovered.

    Javed


    Object permissions are required unless the account is a member of a privileged role.  Try granting object permissions to the user:

    GRANT EXECUTE ON DATABASE::ASPState TO [NT AUTHORITY\NETWORK SERVICE];
    

     


    Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/
    • Marked as answer by Jav Sunday, February 20, 2011 4:46 PM
    Saturday, February 19, 2011 10:57 PM

All replies

  • Have you added the application pool account to the aspstate database and granted permissons on the procs?

     


    Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/
    Saturday, February 19, 2011 6:30 PM
  • Thanks Dan,

    I do have a login and a user account for NT AUTHORITY\NETWORK SERVICE.  Now when using SQL 2005 I have never had to grant any permissions and I haven't done that here.

    The error message appears to imply that even the ASPState database is not being discovered.

    Javed

    Saturday, February 19, 2011 7:56 PM
  •  

    " Moved by Bob Beauchemin MVP 2 hours 52 minutes agoMoved to a slightly more relevent forum. Really should be reposted to ASP.NET forums (From:.NET Framework inside SQL Server) "

    Dear Bob Beauchemin MVP,

    I understand your desire to keep your forums neat and tidy, but if you are moving a thread to a totally different forum, it would be polite to also create a link to where you moved it to.

    As it is, you have essentially thrown my messages into the trash.  It is like telling someone that his luggage has been moved to Brazil.  Does it really take a lot to realize that!!!!!

    Incidentally, as far as I am concerned, I think that my question had as much to do with SQLServer 2008 as it does to ASP.Net

    Saturday, February 19, 2011 9:49 PM
  • Thanks Dan,

    I do have a login and a user account for NT AUTHORITY\NETWORK SERVICE.  Now when using SQL 2005 I have never had to grant any permissions and I haven't done that here.

    The error message appears to imply that even the ASPState database is not being discovered.

    Javed


    Object permissions are required unless the account is a member of a privileged role.  Try granting object permissions to the user:

    GRANT EXECUTE ON DATABASE::ASPState TO [NT AUTHORITY\NETWORK SERVICE];
    

     


    Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/
    • Marked as answer by Jav Sunday, February 20, 2011 4:46 PM
    Saturday, February 19, 2011 10:57 PM
  • Dan,

    Thank you, Thank you, Thank you.

    I made the NETWORK SERVICE a db_owner, and it worked. Much obliged.

    Javed

     

    Dear Bob Beauchemin MVP,

    See! There are people in the world who are actually knowledgeable about these things.

    Sunday, February 20, 2011 3:02 PM
  • I'm glad you were able to sort out the permissions, Jav.  I want to mention that adding the account to db_owner is not a best practice.  You should instead jsut grant execute permissions to the user.

    In Bob's defense, this thread is applicable to multiple technologies.  On the one hand, ASPState is just another database so the normal SQL authentication and authorization rules apply.  But the schema and security context are specific to ASP.NET.  We try to guide questions to the most appropriate forum so that your question may be answered more quickly.  Also, this can help others with the same question find the answer without asking the same question again.

     


    Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/
    Sunday, February 20, 2011 5:28 PM
  • Dan,

    I was not upset that my post had been moved, after all I just wanted an answer and if the other forum was better - that would be fine. 

    Here's what happened after I went to the ASP forum.  I looked around in the State Management area to see if I can find it.  I then tried to search for it using different phrases.  After the second try the search functionality croaked.  That's right - a big message about "we have a problem - come back later"  I tried a few more times thinking that it was a fluke but no - the search was really gone.  I returned after a while and tried using the exact title as well as small fragments of of the title to search but could not find the post.

    At that point I decided to copy the text of my message here and create another post with the same exact title and pasted the message.  I thought surely my typing the same exact title will bring up the other mesage - but nothing.  I clicked Submit and walked away.  A few minutes later I get two emails from the manager of ASP forum shaking his finger at me because I posted the same message twice.

    I hardly ever post anything, but I try to be a good citizen whenever I do.  I think that if a message is moved, it is important that a link to it be provided so that the questioner can go straight to it.  By the way that post in the other forum is still unanswered.

    I will take your advice and use the execute permissions rather that db_owner.  And my apologies to Bob for my outburst.  It was the frustration of the whole series of events.

    Javed

    Monday, February 21, 2011 12:55 AM