I want to use ASP.NET Application Services but configure it to use a different schema. I'm using the aspnet_regsql.exe tool as outlined in this URL which by default creates tables and stored procs with a dbo schema.
So i thought i could just generate a database script from existing Application Objects and then find and replace [dbo]'s with [example], and then delete the original Application Services objects and execute the edited script to get the outcome I wanted. Would have only taken a jiffy.
But in reading this Scott Gu blog post there are people in the comments section who have tried this very approach and found it fell over. Scott replied by requesting an email about the issue, which I assume is an acknowledgement of the problem, but I dont see any resolution.
So I'm at the data modelling stage and I really dont want a whole lot of hassle down the track. Does anyone know if this has been resolved or if there continue to be any snags in the find and replace approach to the 'dbo' schema problem?
UPDATE:
So i didn't even get "very far down the track" before the above fell over. It's obviously easy enough to configure the database so that all the objects properly reference each other using the new schema but its appears all the support code has hardwired "dbo" references in it... rather than using the default schema of the connecting user account.
Simply trying to use the VS Studio > Project | ASP.NET CONFIGURATION tool is enough to break it. After altering the web config to point at the new database with the adjusted schemas and then going to the Security Tab of the config tools I get an error "Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'". So it appears 'dbo' has been baked in. :(
UPDATE 2:
So I've added in SYNONYMS as outlined in the accepted answer and it works but I did have to enter 4 records into the database in order to get it rolling. That took a whole 30 seconds. ;)
Before doing this I got the following error:
The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'
So I had to copy an application row from the aspnet_Applications table. And then 3 rows from the aspnet_SchemaVersions table. I got these from a default dbo schema install.
This was the aspnet_Applications record (masked 'xxxx' for uniqueness - you'll have to make your own key):
/ / xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx NULL
These were the aspnet_SchemaVersions records:
common 1 True
membership 1 True
role manager 1 True
It all works now though. I will update this post if I encounter any problems in the future.