Note: This article was originally published in 2011. Some steps, commands, or software versions may have changed. Check the current .Net documentation for the latest information.
I am running into an issue when I import a db into a SQL Database project which indicates that “Error 1 SQL03006: User: has an unresolved reference to Login ”. After doing some research I found out that to be able to execute the Create User command the x.user.sql file contains you need to have a SQL Server object to handle that dependency. One way to resolve this issue is to simply not have any users and create a post deployment tasks to add the users (assuming their logins exist) or do that as a manual task. You can turn off schema checking on (Tools > Options > Database Tools > Schema Compare > SQL Server > ‘Object Type’ tab) for users, etc. Another way which is a bit more complex includes adding a Server project so that the referenced LOGIN object exists in your solution and can be controlled from VS. The problem with this as you could expect is that having a Server project involves VS managing several Server objects and that might not work in your environment (Think master db, etc).
Summary
This guide covered the common causes and solutions for this .Net issue. If the problem persists, check the official documentation or system logs for additional diagnostic information.