1
votes

I am building a deployment script that should use the version of files available on the host machine to run the contained tasks/targets. My local Machine(Windows 7 64-bit) has Visual Studio 10, 2013 and 2014 installed on it and so when I explore to the C:\Program Files (x86)\ , I see that Microsoft Visual Studio 10.0,Microsoft Visual Studio v11.0,Microsoft Visual Studio v12.0, Microsoft Visual Studio v14.0 but missing from the contents of Microsoft Visual Studio C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft is ...SQLDB\Dac\120\Microsoft.Data.Tools.Schema.Tasks.Sql.dll which MSbuild expects to exist in order to property run my db deployment script.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Da ta.Tools.Schema.SqlTasks.targets(469,5): error MSB4062: The "SqlModelResolutionTask" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SQLDB\Dac\120\Microsoft.Data.Tools.Schema.Tasks.Sql.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SQLDB\Dac\120\Microsoft.Data.Tools.Schema.Tasks.Sql.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

What Software pack/SDK do I need to install on my machine to get ..SQLDB\Dac\120\Microsoft.Data.Tools.Schema.Tasks.Sql.dll, and other service packs needed for successful build in my case?

1

1 Answers

2
votes

The issue here is that when running build from the command line MSBuild has to guess the value of VisualStudioVersion if it's not explicitly set. The targets file defaults this to v11.0 (VS2012), but you want 12.0 (VS2013). In your script you can specify the version explicitly:

msbuild <myproject.sqlproj> /p:VisualStudioVersion=12.0

This should ensure that the VS2013 targets file is used. Similarly for 2012 you'd set the version=14.0.