Search code examples
buildvisual-studio-2015sql-server-data-tools

TFS Build server error of the VS2012 database project converted to to VS2015


I have converted a Visual Studio 2012 database project to Visual Studio 2015. When the project is build on TFS Build server the following error happens

C:\Builds\\Sources\ (136): 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 declaration is correct, and that the file exists on disk.

In my understanding, the Build Server tries to find SSDT for Visual Studio 2012 (v11.0). However, it cannot find it because there is only VS 2015 installed on my Build Server machine. The VS2012 SSDT is not installed.

My questions are 1. Is my interpretation of the error correct? 2. Why VS2012 data base project was not automatically converted to use VS2015 SSDT? Is it a normal conversion behaviour or I did something wrong?

Please, help if you have an answer.


Solution

  • The issue here is that your build template is not setting "VisualStudioVersion=14.0" to indicate that VS 2015 should be used. You can resolve by editing your build configuration - add "/p:VisualStudioVersion=14.0" to the MSBuildArguments section of the Process tab. Note that most newer build templates for TFS 2015 should do this automatically.

    The reason this affects sql projects is that they find the DLLs to build them under the VS install directory. This parameter controls which version of Visual Studio is available and can be used.

    For background reading the [whitepaper on TFS Build, Test & Deploy][1] is a good start, as is the shorter presentation based on this material.

    Disclosure: I work on the SSDT team and wrote the presentation linked above.