Ken Wong Software Development Blog

April 24, 2007

ASPState Installation Gotcha

Filed under: ASP.NET — canonw @ 11:08 am

My development machine is getting unstable. So I decided to reload my computer from scratch.

One of the tasks is to install ASPState to ASP.Net applications. It’s been a long time I install ASP.Net. And I’m repeating the same old mistake I made years ago.

I run this command:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql.exe

That program guides me through a wizard. And it installs aspnetdb database on my machine.

But when I execute my ASP.net from Visual Studio, I get this error message:

Cannot open database requested in login ‘ASPState’. Login fails. Login failed for user ‘???’.

Hmm, that’s puzzling. I spent an hour finding out the error, and it turns out I need to run the command this way.

aspnet_regsql.exe -ssadd -sstype p -E

The wizard in aspnet_regsql.exe does not support for ASPState. I must add these parameters to create another database called ASPState.

Things are looking good. Well, almost. I got another error message when I run the ASP.Net application.

EXECUTE permission denied on object ‘GetMajorVersion’, database ‘ASPState’, owner ‘dbo’.

This is obvious to me. And the solution is simple. I must grant the database access to ASPState to appropriate users, and grant stored procedure in database ASPState EXEC permission to these users.

Here’s my lesson.

  • Write down note just to remind myself. I went through this problem before, and I totally forget all these details. If I spent time to write it down, I don’t have to go through the pain twice.

Here’s interesting link related to ASPState

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Blog at WordPress.com.