Share via


sqlproj and dbmdl

Question

Tuesday, April 22, 2014 6:56 AM

I have a solution with sqlproj. I did not commit the dbmdl file to the version control (SVN). When I compile the solution in VS it succeeds, but when I compile it with command line (devenv) it fails most of the times.

I managed to compile in command line once by deleting the dbmdl file, but after that time I could not compile it again.

The exception I get is:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException

Is there anything I can do to make it work?

All replies (2)

Wednesday, April 23, 2014 5:47 AM ✅Answered

Hi,

As far as I know, dbmdl file is effectively a temporary copy of the schema model and is created when a project is opened. The file can’t be checked into source control. And if we remove it, we may get some errors because the dbmdl file may contains some references. For more information, please see this thread: http://stackoverflow.com/questions/3634649/what-is-the-function-of-the-dbmdl-file-in-vs-database-project

Please rebuild the VS2012/2013 sql server database project again from Visual Studio and generate the dbmdl file.

In addition, you said that you got errors when you build the sqlproj from devenv.exe command line, why did you want to build the sqlproj from command line? Your VS can build it well.

If you build the project using devenv.exe, please reference this article: http://msdn.microsoft.com/en-us/library/b20w810z.aspx to make sure that you use the correct command line options.

If you can’t build it using devenv.exe, I know we can build the database project with MSBuild.exe: http://msdn.microsoft.com/en-us/library/ms164311(v=vs.110).aspx

Jamie Thompson blogged about this here: http://sqlblog.com/blogs/jamie_thomson/archive/2013/03/10/deployment-of-client-specific-database-code-using-ssdt.aspx

You can try it.

Best regards,

Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.


Thursday, January 4, 2018 9:28 PM

Quote: "In addition, you said that you got errors when you build the sqlproj from devenv.exe command line, why did you want to build the sqlproj from command line? Your VS can build it well."

Though very old post...

In my case, I try to use a Continuous Integration Builder
and therefore have to do so as a script.