A Visual COBOL solution exists which contains several COBOL managed code projects. The solution build fine when the build is done from within Visual Studio 2010 or when done through the msbuild utility run from a Visual COBOL 2010 32-bit command prompt.
However when the same solution is built using Team Foundation Server 2010 (TFS) it fails with errors that reference the assembly 'MicroFocus.COBOL.CompilerUtil.
The error shows that MSBuild could not find the above said assembly. The build errors will look like the following:
C:\Program Files (x86)\MSBuild\Micro Focus\Visual COBOL\v1.0\MicroFocus.COBOL.targets (533): The "CobolDependencies" task could not be instantiated from "MicroFocus.Cobol.BuildTasks, Version=126.96.36.199, Culture=neutral, PublicKeyToken=0412c5e0b2aaa8f0". System.TypeInitializationException: The type initializer for 'MicroFocus.COBOL.BuildTasks.BaseTask' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'MicroFocus.COBOL.CompilerUtil, Version=188.8.131.52, Culture=neutral, PublicKeyToken=0412c5e0b2aaa8f0' or one of its dependencies. The system cannot find the file specified. at MicroFocus.IDE.Util.NativeMethods.LoadEntryPoints() at MicroFocus.IDE.Util.NativeMethods.get_VisualCOBOLBin() at MicroFocus.COBOL.BuildTasks.BaseTask..cctor() --- End of inner exception stack trace --- at MicroFocus.COBOL.BuildTasks.BaseTask..ctor() C:\Program Files (x86)\MSBuild\Micro Focus\Visual COBOL\v1.0\MicroFocus.COBOL.targets (533): The "CobolDependencies" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.
This will be a problem if Team Foundation Server is running on a 64-bit Operating System like Windows 7 or Windows Server 2008. Visual COBOL 2010 R3 does not currently support building COBOL projects via 64-bit version of msbuild. TFS will need to be configured to run the 32-bit version of msbuild instead. Please consult your TFS documentation for instructions on how to set this up.