Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database msbuild publish not working from command line

I am trying to Publish a .sqlproj from command line with MSBuild with 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 weird is that from Visual Studio 2012 i can Publish the same project successfully. Does Visual Studio set any magical msbuild property before publishing to get the .targets file from another directory?

like image 631
Arthur Rizzo Avatar asked Aug 19 '13 12:08

Arthur Rizzo


1 Answers

You should pass the following argument to MSBuild:

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

This tells msbuild to use VS2012 targets.

Passing VisualStudioVersion is required hence VS2010 and Vs2012 can share the same project file: i.e. project file does not store target VS version inside itself

like image 97
Isantipov Avatar answered Nov 07 '22 15:11

Isantipov