views:

896

answers:

2

I have two Visual Studio database projects. Both build fine on my local dev environment. On the TFS build server, with a TFS build solution containing both projcets, one builds fine and the other fails with this error:

Task "SqlBuildTask"
  Creating a model to represent the project...
C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(58,5): error MSB4018: The "SqlBuildTask" task failed unexpectedly.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(58,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(58,5): error MSB4018:    at Microsoft.Data.Schema.Tasks.TaskHostLoader.Load(ITaskHost providedHost, TaskLoggingHelper providedLogger)
C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(58,5): error MSB4018:    at Microsoft.Data.Schema.Tasks.DBBuildTask.Execute()
C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(58,5): error MSB4018:    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)

I've noticed the following difference in the build log, which I think is relevant, but I don't know what is causing it.

Good project:

Overriding target "Build" in project "C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets" with target "Build" from project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.VisualStudio.TeamSystem.Data.Tasks.targets".

Failing project:

Overriding target "Build" in project "C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets" with target "Build" from project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.Common.targets".

Both DB projects include the following import (only):

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" />

Clues welcome!

+3  A: 

Ahh, the problem was that I didn't have the GDR release installed on the build server. One project was created with VSDB RTM, the other with VSDB GDR.

If only there were better error messages to help diagnose this!

Craig Fisher
A: 

Hi,

Which project was built using the VSDB RTM and which with VSDB GDR? I'm facing exactly the same problem but am not sure how to fix it.

I've installed the GDR R2 (from http://www.microsoft.com/downloads/details.aspx?FamilyID=bb3ad767-5f69-4db9-b1c9-8f55759846ed&amp;displaylang=en) on my build server, but no luck.

Is there a different GDR I should have installed? Or is there something specific I should be doing with my dbproj file?

As always, any help much appreciated.

Thanks Padda

Padda
Apologies, this has already been answered here:http://social.msdn.microsoft.com/Forums/en/tfsbuild/thread/f84dab82-2e4e-41d0-acd8-5d1a7da585f4
Padda