Last post Mar 03, 2006 11:02 PM by robertv
Feb 28, 2006 08:29 AM|robertv|LINK
I have an issue with the authentication on the personal website starter kit (or any site using the login controls for that matter). I guess I’m just not configuring something on my 2003 box and thought maybe someone could point me in the right direction.
I installed the starter kit and created a new site. I added 1 user with admin rights and everything works fine. When I publish the site to my windows 2003 box (with SQL 2005 Express installed on it), the site functions but will not allow me to login.
I browsed around and found a reference to a utility called aspnet_regsql.exe. Do you need to run this utility? I tried and only get an error that it cannot connect to the database ‘aspnetdb’ which is a file in the app_data folder for the website.
I used the SQL Server Management Studio to attach that database manually and I was then able to log into the website. It seems I should not have to do that as the connect string should attach that table.
Am I missing something? Is there a setting in Windows 2003 server that has to be changed to make this work? Thanks in advance
Mar 01, 2006 10:42 PM|robertv|LINK
Mar 02, 2006 01:54 AM|jwadsworth|LINK
I think most people are using SQL Server 2005 or SQL Server 2000 on their hosting server.
In my case, I use SQL Express on my development machine for working with the Personal Site Kit. When I deployed my site to Webhost4life, I first attached my personal.mdf, located in my App_Data folder, to SQL Server Management Studio Express. I then created
a personal.bak (backup) of my database. I uploaded the bak file to Webhost4life, created a database using my hosting control panel, then restored the bak file over the database I had just created. I changed my connection strings and it all worked.
The aspnet_regsql tool is for creating the membership tables in your Persoanl database. This allows you to just use one database for the site and the security. You still need both connection strings. They should both point to your site database (Personal.mdf)
after you have created the membership tables in your site database. When I used the aspnet_regsql tool, I first attached my Personal database in SQL Server Management Studio Express. I then ran the tool and pointed to the attached database. When I was finished,
I detached the database and copied the Personal.mdf back into my App_Data folder so I could use SQL Express locally.
Mar 02, 2006 03:11 PM|rgibson69|LINK
I am using my own W2K3 box as well. In my case I am running VS and SQL Express on the W2K3 box. When I copy the web site including databases from my test directory to the IIS directory I have always been able to log in. The one thing I did have to do is
check the permissions on the App_Data dir and the database files themselves to make sure Network Service had full rights to the databases.
Mar 02, 2006 03:49 PM|Howeird|LINK
Mar 03, 2006 11:31 AM|Howeird|LINK
Add Network Service account to your App_Data folder with write access. This permision will get over-written everytime you publish. A solution would be to give Network Service write access higher up the directory structure. I'm not sure whether this would
be s serious security hole. If you have started the web site since you published, you will have to perform an 'iisreset' to pick up the new permissions.
Mar 03, 2006 11:02 PM|robertv|LINK
Thanks everyone for your help. I was a permissions issue on the APP_DATA folder. I should have known, its always a permissions issue ;)