Invalid object name ‘dbo.UserProfile’ in mvc4

If you are trying to use the simplemembership in mvc4 in visual studio and if you get this error

Invalid object name ‘dbo.UserProfile’ in mvc4

 

Here is a simple fix for this

This error will come when your table owner is not dbo.

Change the table ownership in SQL Server by using the following command

EXEC sp_changeobjectowner 'UserProfile',  'dbo'