Tuesday, April 27, 2010

TFS 2008 Build Server and VS 2010

Had to install VS 2010 on the TFS 2008 build server machine, so that I could get continuous integration with VS 2010 solutions. (We are not moving to TFS 2010 just yet as we have a dependency on Office 2003).

After having installed VS 2010 on the build server all CI builds were failing. First with the error:

Error MSB4131: The "Reason" parameter is not supported by the "GetBuildProperties" task. Verify the parameter exists on the task, and it is a gettable public instance property.

The simple work-around/hack for this is to open the “C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets” file and comment out the line

<Output TaskParameter="Reason" PropertyName="Reason" />

Once you do this, you will come across another error:

error MSB4018: The "CreateWorkspaceTask" task failed unexpectedly.

Turns out this is because VS 2010 modifies the Build.Targets file’s Workspace entry to the following:

<WorkspaceName Condition=" '$(WorkspaceName)'=='' " >$(COMPUTERNAME)_$(BuildDefinitionId)_$(BuildAgentId)</WorkspaceName>

TFS 2008 does not like the _$(BuildAgentId). So if you set the value to $(COMPUTERNAME)_$(BuildDefinitionId) life should get back to normal for you.

Finally, if you need to VS2010 to work with your build server, edit the “C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\tfsbuildservice.exe.config” file and set the MsBuildPath.

<add key="MSBuildPath" value="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\" />

No comments:

Post a Comment

Remember, if you want me to respond to your comment, then you need to use a Google/OpenID account to leave the comment.