1
votes

I'm trying to deploy my application to my host but when I attempt to log in I get the exception:

System.Data.SqlClient.SqlException: Invalid object name 'dbo.UserProfile'.

This worked fine when I did it on localhost.

The reason seems to be that however the asp.net mvc 4 built in membership system creates it's database, it creates them with the schema "Username.databasename" instead of "dbo.databasename" as it did on localhost and it seems to be expecting.

I'm wondering if there is a way to force it to create databases with the correct schema or tell mvc to look for a database with the other schema.

Another possibly relevant detail is that all my other database tables I create with EF code first have the "dbo" schema.

EDIT: All the names I referred to above are table names, the database it creates is called defaultconnection sorry about that.

1
I'm confused, dbo.UserProfile is a table name not a DB. What name did the ASP.Net MVC membership provider give that table when it was created?TSmith

1 Answers

1
votes

I have the same issue. The workaround for me was to change the schema:

 ALTER SCHEMA dbo TRANSFER yourschema.Table1