Error "SQLBuildTask" The task cannot be loaded from the collector "Microsoft.Data.Schema.Tasks.Sql"

I am trying to create a db project using msbuild.exe running on a virtual machine with Windows Server 2008 R2 Enterprise for 64-bit OS. Most of my applications work successfully, this one DB project gives me problems .. NET Framework 2 and 4. Installed.

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.

I already checked a possible solution on this site: Getting MSBuild and CruiseControl.NET to create and deploy VS2010 database projects

However, I have VS2010 installed on my build machine and I still get this error

Things I've already done:

  • Checked that the solution with the database project was successfully completed in VS2010
  • Run the msbuild command using msbuild MyDBtest.dbproj. This gives me the same error.

What else can I lose to make this work?

+4
source share
1 answer

Turns out I was running the wrong version of MSbuild for dbproj. I needed to use the one that was in C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319, and not C: \ Windows \ Microsoft.NET \ Framework64 \ v2.0.50727. Earlier versions do not support the .dbproj type.

+4
source

All Articles