4

I'm trying to build a db project using msbuild.exe, running on a VM with Windows Server 2008 R2 Enterprise for 64-bit OS. Most of my applications are building successfully, this one DB project is giving me problems. .NET Framework 2 and 4 are 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 have already checked out a possible solution on this site: Getting MSBuild and CruiseControl .NET to build and deploy VS2010 database projects

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

Things I have done already:

  • Checked that the solution with the DB project builds successfully in VS2010
  • Run the msbuild command using msbuild MyDBtest.dbproj - This gives me the same error.

What else could I be missing to get this to work?

Community
  • 1
  • 1
Cheri
  • 81
  • 5

1 Answers1

4

Turns out I was executing the wrong version of MSbuild for the dbproj I needed to use the one in C:\Windows\Microsoft.NET\Framework64\v4.0.30319 and not C:\Windows\Microsoft.NET\Framework64\v2.0.50727. Earlier versions don't suppport the .dbproj type.

Cheri
  • 81
  • 5