v60 toolset and TFS 2013 build

Jul 26, 2014 at 3:51 AM
I'm getting this error from a TFS 2013 build agent running on Windows Server 2012 R2:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v60\Microsoft.Cpp.Win32.v60.targets (93): The "CLA" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v60\Daffodil.CPPTasks.Win32.v60.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v60\Daffodil.CPPTasks.Win32.v60.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. 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.

The solution will build from within VS2013 but not when the TFS build service builds it. I'm thinking it could have something to do with MSBuild ToolsVersion. Any ideas? Thanks.
Jul 26, 2014 at 4:49 AM
It sounds to me like your .NET security policy is preventing the assembly from loading for whatever account your TFS build service is running under.
Jul 27, 2014 at 6:05 PM
Setting "MSBuild platform" in the build definition to "X86" instead of "Auto" fixed the problem.