Recently I got a question about permissions error that occurred when trying to create database project in the local instance of Microsoft SQL Server used for design-time validation. The error was: "CREATE DATABASE permission denied in database 'master'".
To create database you must be a member of the dbcreator and securityadmin fixed server roles in the server instance that you specified for design-time validation.
First, ensure that the instance name that is specified for your design-time validation database is correct.
Second, a user with sysadmin permissions should run the following script on your design-time validation database:
GRANT EXECUTE ON sp_detach_db TO public
For more information read Required Permissions in Database Edition.