Friday, May 16, 2014

Visual Studio Deploying DatabaseProject Error Could not find DATABASE.SQLPERMISSIONS

I had this error today with my vs.net 2010 database project. I hope this simple fix helps you solve your issue.

  Error message: Could not find a part of the path 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 10.0\COMMON7\IDE\PROPERTIES\DATABASE.SQLPERMISSIONS'. C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 10.0\COMMON7\IDE\PROPERTIES\DATABASE.SQLPERMISSIONS

The first thing I did was check the history of the database project and yet there was nothing unusual that had changed. Then I check to see if I actually had that file in the path that it was given and nope I did not had it. Obviously vs.net was looking at the wrong path. The file did existed within the database project path \properties\ folder.

 The answers on stackoverflow.com did not helped me at all.
 Then I remembered about the metadata files so I went into the location of the database project file and removed the *.dbmdl files and the .user files associated to my database project file.

In order to remove those files I had to first unload the db project from visual studio, otherwise you get an error.   That did the trick. Load the project again and I was able to successfully deploy the database project.