Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build .sqlproj projects on a build server?

I have many .sqlproj projects that need to be built on our build server. I don't want to install all of Visual Studio on the build server just so I can install SSDT to build these. How can I build .sqlproj projects without a full VS install?

Here's the raw error I get on the build server when trying to build without SSDT intstalled:

C:\MyProject\MyProj.sqlproj (4): The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. 
like image 696
Daryl Avatar asked Mar 21 '13 19:03

Daryl


People also ask

What is .sqlproj file?

Database development project created by Visual Studio, a Windows software development IDE; stores the schema of the database and can include SQL source code; used for creating databases for SQL Server, Microsoft's relational database management system (RDBMS) software.

What is SqlPackage EXE?

SqlPackage.exe is a command-line utility that automates the following database development tasks by exposing some of the public Data-Tier Application Framework (DacFx) APIs: Version: Returns the build number of the SqlPackage application. Added in version 18.6. Extract: Creates a data-tier application (.

What is a Dacpac?

dacpac can be used to update a database with new or modified objects, to revert to a previous version of the database, or to provision an entirely new database. Conversely, a . dacpac can be generated from an existing database and used to establish a SQL database project based on the current database schema.

What is a database project?

Project Database means a searchable database maintained in connection with an ongoing project of Subscriber which must consist predominantly of Subscriber's own Work Product with access limited to those internal Users actively working on the project.


2 Answers

Answer: Microsoft now has an official NuGet package (see blog post).


Old answer, prior to August 2016; provided in case the NuGet package doesn't work for you:

  1. Install dacframework.msi (x86|x64)
  2. Install SQLDOM.MSI (x86|x64)
  3. Install SQLLS.MSI (x86|x64)
  4. Install SQLSysClrTypes.msi (x86|x64)
  5. Install SSDTBuildUtilities.msi (from the "Administrator Install Point" as setup in step 3 here)

Done!

Source: Headless MSBuild Support for SSDT (*.sqlproj) Projects.

like image 109
Daryl Avatar answered Sep 28 '22 01:09

Daryl


Microsoft SQL Server Data Tools: http://msdn.microsoft.com/en-us/data/hh297027

Install the tools on build machine to fix the problem.

like image 27
Ievgen Martynov Avatar answered Sep 28 '22 01:09

Ievgen Martynov