0

I have recently migrated my visual studio 2010 projects to 2013 but my database project looks unhappy about it. I have a TFS build definition which helps me deploy the database project and i have specified the (.sln) solution file and the .proj separate file which helps e drop the file to some location. This has been working well when I was using 2010 but right now its giving me the following error.

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.

I replaced .sln file with the .sqlproj and this seems to fix the failing build definition but I don't get any deployment files. Do you have any suggestions please, this is blocking my work right now.

1 Answer 1

2

You need to set the environment variable VisualStudioVersion=12.0 when building from the command line if you are using VS2013. SQL Projects rely on this to detect whether to use the VS2012 (v11.0) or VS2013 (v12.0) targets file when building.

Normally when a new Visual Studio version is released there's an accompanying .Net version update that changes the default VisualStudioVersion default value, but with VS2013 this didn't happen. Hence SQL Projects (and some other resources with similar version-specific dependencies) require 12.0 to be explicitly set as the version, since 11.0 is the default.

Also when running on a build server you must have a version of Visual Studio 2013 installed that includes the SQL Server tools. Full instructions on setting up a build server are in the whitepaper and presentation on the SQL Server tools team blog.

Sign up to request clarification or add additional context in comments.

7 Comments

I am using TFS build definition and I have set /p:VisualStudioVersion=12.0 on MSBuild Arguements, do i still need the environment variable?
still get this ": The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk."
That argument does set the environment variable to 12.0. How is the path getting set to include TeamData instead of SSDT? The path should be "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" - see how this has "SSDT" instead of "TeamData" in your example. You should look at your .sqlproj file and see if TeamData is set anywhere. If not, have you got a value for the SQLDBExtensionsRefPath variable set anywhere? In the latest release (July 2014) this can override the path - other than that I can't see how this is getting changed.
Also you should look at the whitepaper and presentations the team put up on the SSDT blog - there should be full instructions on setup, creating build definitions and other stuff there. It's at blogs.msdn.com/b/ssdt
I found this in my .sqlproj file. " <Import Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" Condition="'$(SQLDBExtensionsRefPath)' != ''" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" Condition="'$(SQLDBExtensionsRefPath)' == ''" />"
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.