【问题标题】:Database msbuild publish not working from command line数据库 msbuild 发布无法从命令行工作
【发布时间】:2013-08-19 12:57:46
【问题描述】:

我正在尝试使用 MSBuild 从命令行发布 .sqlproj,命令如下: msbuild /t:Publish [MySqlProjPath] 但我收到以下错误:

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.

我觉得奇怪的是,我可以从 Visual Studio 2012 成功发布相同的项目。 Visual Studio 是否在发布之前设置了任何神奇的 msbuild 属性以从另一个目录获取 .targets 文件?

【问题讨论】:

    标签: msbuild sqlproj


    【解决方案1】:

    您应该将以下参数传递给 MSBuild:

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

    这告诉 msbuild 使用 VS2012 目标。

    需要传递VisualStudioVersion,因此 VS2010 和 Vs2012 可以共享同一个项目文件:即项目文件本身不存储目标 VS 版本

    【讨论】:

    • 太棒了,就像我的一些解决方案期待 2013 组件一样,这已经修复了 /p:VisualStudioVersion=11.0
    猜你喜欢
    • 2018-12-25
    • 1970-01-01
    • 1970-01-01
    • 2013-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-12
    相关资源
    最近更新 更多