Search code examples
sql-server-2005visual-studio-2008dbprojvisual-studio-dbpro

Visual Studio error when trying to open dbproj files


I have Visual Studio 2008 Database Edition, and everything worked great until the first time I tried to load a .dbproj file. These database project files work for the other developers I work with, but when I try to open it, I just get an error message "Object reference ot set to an instance of an object."

Load dbproj

It's probably the same problem this guy is having, although he didn't do a good job of describing it and has no solution.

Every other kind of project file loads and builds and runs normally. dbproj files all generate this cryptic error. I just tried a fresh removal and reinstall of Visual Studio 2008 DE to no avail. Could this have something to do with my SQL 2005 installation? (This also works normally through SQL Server Management Studio.)

** UPDATE **

Probably even more importantly, this same error occurs when I try to make a new dbproj file. Every other type of project can be created no problem.

New dbproj


Solution

  • You need to tell Visual Studio the correct instance of SQL Server to use for validation.

    Tools>Options>DatabaseTools

    Change the settings in "Data Connections" and "Design-time Validation Database" to reflect the correct instance.