How to build .sqlproj projects on a build server?

人盡茶涼 提交于 2019-11-27 05:10:31

问题


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.

回答1:


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.




回答2:


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

Install the tools on build machine to fix the problem.




回答3:


The Microsoft SQL Server Data Tools team has released a NuGet package named Microsoft.Data.Tools.Msbuild, which helps to build SQL Projects on build servers.

see : https://blogs.msdn.microsoft.com/ssdt/2016/08/22/releasing-ssdt-with-visual-studio-15-preview-4-and-introducing-ssdt-msbuild-nuget-package/

NuGet package : https://www.nuget.org/packages/Microsoft.Data.Tools.Msbuild/




回答4:


SSDT v12.0.50730.0 requires Visual Studio to be installed beforehand. I found the easiest solution was to install the bare minimum Visual Studio components which were downloaded from MSDN Subscriber downloads:

  • Visual Studio 2013 Isolated
  • Visual Studio 2013 Shell

Then SSDT installed fine.

I also used part of the solution outlined above.
* Install dacframework.msi * Install SQLDOM.MSI * Install SQLLS.MSI * Install SQLSysClrTypes.msi

I use MSBuild 12.0 to perform the build which is also available as a separate download.



来源:https://stackoverflow.com/questions/15556339/how-to-build-sqlproj-projects-on-a-build-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!