Search code examples
visual-studio-2013msbuildmicrosoft-fakes

MsBuild error MSB1025 - System.Threading.Tasks.Dataflow not found (following fake generation problems)


I have a problem with the standard MSBuild.exe used on our Team Build server, the standard version used is in

  • "C:\Windows\Microsoft.NET\Framework\v4.0.30319", version 4.0.30319.18408 or
  • "C:\Windows\Microsoft.NET\Framework64\v4.0.30319" respectively (same version).

Using this version leads to Fake dlls not being generated in the same way as on our local development machines (i.e. some fake methods are missing on the server), resulting in broken builds (unit tests) on the TFS.

I updated the build definition template to use the MSBuild version located under "C:\Program Files (x86)\MSBuild\12.0\Bin" as it is more recent (version 12.0.30723.0), however, this results in an error MSB1025, System.Threading.Tasks.Dataflow, Version=4.5.9.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a not found.

Update

Further investigation - manually adding the System.Threading.Tasks.Dataflow.dll with the correct version number to the MSBuild directory results in a broken build with

Unsupported ToolsVersion 12.0

Manually setting the ToolVersion in the Microsoft.TeamFoundation.Build.Workflow.Acitvities.MSBuild element to "4.0" results in a broken build with

Cannot set unknown member "Microsoft.TeamFoundation.Build.Workflow.Activities.MSBuild.ToolVersion"

So... no real improvement.

Any ideas how to fix this?


Solution

  • Fakes is sensitive to the Visual Studio version. Try passing /p:VisualStudioVersion=12.0 to MSBuild arguments. Also avoid handling System.* assemblies manually.