Error: The "CreateWorkspaceTask" task failed unexpectedly

I am getting an error when trying to run a build in TFS. The specific error is a casting error from object of type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace' to type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace'.

The builds used to work a while back and I don't know of any changes that have occured on either the development machine, build server or TFS server. Any ideas?

The contents of the log are such:

Build started 4/26/2006 7:58:25 AM.
__
Project "e:\vsts\build\LarryIsHere\testbuild\BuildType\TFSBuild.proj" (EndToEndIteration target(s)):

Target InitializeEndToEndIteration:
UpdateBuildNumberDropLocation BuildNumber='testbuild_20060426.1' DropLocation='\\v070P1\Drops\testbuild_20060426.1'


Target InitializeBuild:
Creating directory "e:\vsts\build\LarryIsHere\testbuild\BuildType\..\Sources".
Target InitializeWorkspace:
DeleteWorkspaceTask Name="V069P1_LarryIsHere_testbuild" TeamFoundationServerUrl="http://v070p1:8080/"
Workspace V069P1_LarryIsHere_testbuild does not exist.
CreateWorkspaceTask Name="V069P1_LarryIsHere_testbuild" TeamFoundationServerUrl="http://v070p1:8080/" MappingFile="WorkspaceMapping.xml" LocalPath="e:\vsts\build\LarryIsHere\testbuild\BuildType\..\Sources" TeamProject="LarryIsHere"
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error : Unable to cast object of type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace' to type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace'.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: The "CreateWorkspaceTask" task failed unexpectedly.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: System.InvalidCastException: Unable to cast object of type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace' to type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace'.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: at Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace.Deserialize(String serializedFile)
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: at Microsoft.TeamFoundation.Build.Tasks.CreateWorkspaceTask.Execute()
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup projectPropertiesAvailableToTask, Boolean& taskClassWasFound)
Done building target "InitializeWorkspace" in project "TFSBuild.proj" -- FAILED.

Done building project "TFSBuild.proj" -- FAILED.

Build FAILED.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error : Unable to cast object of type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace' to type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace'.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: The "CreateWorkspaceTask" task failed unexpectedly.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: System.InvalidCastException: Unable to cast object of type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace' to type 'Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace'.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: at Microsoft.TeamFoundation.Build.Tasks.SerializedWorkspace.Deserialize(String serializedFile)
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: at Microsoft.TeamFoundation.Build.Tasks.CreateWorkspaceTask.Execute()
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets(306,5): error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup projectPropertiesAvailableToTask, Boolean& taskClassWasFound)
0 Warning(s)
2 Error(s)

Time Elapsed 00:00:02.62

[4921 byte] By [lguger] at [2008-2-27]
# 1

Seems like there is some sort of version mismatch.

What TFS/Team Build version are you working on? Have you upgraded to RTM recently or anything like that?

Thanks,

Gautam

GautamGoenka at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 2

I am working with the RC version. The assemblies on the TFS Server are 8.0.0.0 and the version number for the Team Explorer in my Visual Studio install are:

Microsoft Visual Studio 2005 Team Explorer
Version 8.0.50727.127

Regards,
Larry

lguger at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 3

What is the File Version of Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll? (It should be .127) Also, is this file there in GAC too? If so, remove it from GAC.

If the above does not help, the last resort may be repair the install.

Thanks,

Gautam

GautamGoenka at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 4

Can you also share the content of workspacemapping.xml file?

ManishAgarwal at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 5
File version is .127 and it is not in the GAC. We are currently assessing the possibility of a reinstall/upgrade.
lguger at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 6
<?xml version="1.0" encoding="utf-8" ?>
<SerializedWorkspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Mappings>
<InternalMapping ServerItem="$/GTN Modernization" LocalItem="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE" Type="Map" />
</Mappings>
</SerializedWorkspace>
lguger at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 7

Larry,

The workspacemapping.xml file is correct. Can you try reinstalling/repairing the bits on your build machine and see if the problem persists?

ManishAgarwal at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...

Visual Studio Team System

Site Classified