Since installing Visual Studio 2015 Update 3 I have been getting the below error. It happens only when Visual Studio 2015 is open and happens whether I am running as a local
I know this is an old'ish post, but the issue is rearing up again since VS 2017 it seems... at least with my (SSDT) SQL database project... so in the hopes that this might help someone else...
The accepted answer works perfectly but is quite manual. The script provided by Mahdi makes it a little bit more automated. In both cases, however, you might (depending on your build/deploy setup) need to run the script on both of the master databases on (localdb)\mssqllocaldb and (localdb)\projectsv1, respectively.
In addition, the problem is that the property keeps getting restored every time you build and run with F5. As it turns out, though, there is a setting on the Debug tab of the project properties page, called Deploy database properties... clear (uncheck) this setting to ensure that the issue doesn't come back.
Note that: a) this is only for Debug mode; and b) it is only applicable to databases under (localdb).