Msbuild database not working from command line

I am trying to publish .sqlproj from the command line using MSBuild using the command: msbuild /t:Publish [MySqlProjPath] , but I get the following error:

error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.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.

What I find strange is that from Visual Studio 2012 I can successfully publish the same project. Does Visual Studio set any magic msbuild property before publishing to get the .targets file from another directory?

+7
msbuild sqlproj
source share
1 answer

You must pass the following argument to MSBuild:

 /p:VisualStudioVersion=11.0 /t:Rebuild;Publish 

This tells msbuild to use the VS2012 targets.

VisualStudioVersion transfer is required, so VS2010 and Vs2012 can share the same project file: for example, the project file does not save the target version of VS inside itself

+12
source share

All Articles