msbuild - 错误 "SQLBuildTask"无法从程序集 'Microsoft.Data.Schema.Tasks.Sql' 加载任务

标签 msbuild dbproj

我正在尝试使用 msbuild.exe 构建一个数据库项目,该项目在装有 64 位操作系统的 Windows Server 2008 R2 Enterprise 的虚拟机上运行。我的大多数应用程序都已成功构建,但这个数据库项目却给我带来了问题。 .NET Framework 2 和 4 已安装。

error MSB4062: The "SqlBuildTask" task could not be loaded from the assembly Microsoft.Data.Schema.Tasks.Sql, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file or assembly 'Microsoft.Data.Schema.Tasks.Sql, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> 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.

我已经在此网站上查看了可能的解决方案:Getting MSBuild and CruiseControl .NET to build and deploy VS2010 database projects

但是我的构建机器上确实安装了 VS2010,但我仍然收到此错误

我已经做过的事情:

  • 检查数据库项目的解决方案是否在 VS2010 中成功构建
  • 使用 msbuild MyDBtest.dbproj 运行 msbuild 命令 - 这给了我同样的错误。

为了让它发挥作用,我还可能缺少什么?

最佳答案

事实证明,我为 dbproj 执行了错误版本的 MSbuild,我需要使用 C:\Windows\Microsoft.NET\Framework64\v4.0.30319 中的版本,而不是 C:\Windows\Microsoft.NET\Framework64\v2.0.50727。早期版本不支持 .dbproj 类型。

关于msbuild - 错误 "SQLBuildTask"无法从程序集 'Microsoft.Data.Schema.Tasks.Sql' 加载任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11761565/

相关文章:

c# - 从命令行完全构建 Monotouch 应用程序包的完整步骤集是什么?

c++ - 如何处理和包含用于在不同计算机上构建 Visual Studio 2010 解决方案的 header 和库

visual-studio - 在 .csproj 中使用条件符号

visual-studio - 如何使用 msbuild 命令行选项禁用 nuget 包还原?

msbuild - 在生成服务器上找不到 Microsoft.WebApplication.targets。你的解决方案是什么?

visual-studio-2010 - dbproj : error : Error HRESULT E_FAIL has been returned from a call to a COM component

msbuild - 在 AppVeyor 中使用 MSBuild 14.0/C# 6.0 构建

visual-studio - 在Visual Studio 2013中不会加载DB Project

visual-studio-2010 - 2008 DB 项目中触发器脚本出现错误 SQL03120