I’ve had 2 problems with the VS 2005 Website Admiistration Tool (WAT), first the site wouldn’t load in my browser correctly, saying unhelpfully that “an error occurred, please try restarting the tool”.
After much head scratching I went over to my Vista laptop, tried it out there and it worked fine. IT dawns on me then that my laptop has IE as the default browser while my dev box has Avant as the default browser. After making IE the default browser on the dev box, the WAT launches without a problem.
The second problem, on both my dev box and laptop occurs when you click on the Security tab. You get a number of error messages the most obvious one mention that it was unable to connect to the datasource and to check your settings on the Provider tab.
After some googling, it turns out that the culprit is a conection string setting which is configured while installing VS 2005. This setting is called LocalSqlServer and it can be found in your machine.config file in the .NET framework directory according to the version of the framework installed. On my machine the default setting is as follows;
<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;
Integrated Security=SSPI;
AttachDBFilename=|DataDirectory|aspnetdb.mdf;
User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
On my laptop I have SQL Server 2005 installed and on the dev box I have SQL Server 2000. The WAT tool uses the LocalSqlServer connection string to connect with a Datastore to use for the Memberships and Roles API, the default instance name for SQL Server 2005 is “SQLEXPRESS” hence the connection string above.The solution is to either change the default in machine.config, or preferably, modify your web.config file to remove the setting inhertited from machine.config and set a new connection string for your web project. After doing the later, my web.config file appears as shown below;
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=HP6715s\MSSMLBIZ;
Initial Catalog=aspnetdb;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
After making this change the Security tab for the WAT works correctly. I should point out that before doing this I’d already run the aspnet_regsql utility to create the schema for the Roles and Membership API, although apparently if you’re using SQL Server 2005 you don’t need to do this as the Wizard will do it for you, I never tried this so I don’t know if thats true.
Thank you very much for this post! I was looking all over the place for a solution, and you finally gave it to me!
Thanks for posting this useful information.
I’ve spen the best part of this afternoon trying to get this(WSAT) working in Firefox. I managed to get WSAT with Firefox once, which is why I have spent the afternoon . Not sure what I did, alas I could not get the security tab running and then I could not get anything running at all.
So I:
set IE as my default browser
and
then added to web.config
Works like a charm
Thanks for the heads up