1

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.

4

1 回答 1

1

我有同样的问题。我的解决方法是更改​​架构:

 ALTER SCHEMA dbo TRANSFER yourschema.Table1
于 2013-10-25T06:01:29.193 回答