Jenkins MSBuild Plugin で Visual Studio 2013 ソリューション / プロジェクトがビルドできない

1 Context

Jenkins MSBuild Plugin で Visual Studio 2013 のソリューションが以下のエラーによってビルドできない。

error MSB4175: タスク ファクトリ "CodeTaskFactory" をアセンブリ "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0.dll" から読み込めませんでした。

2 Cause

Most of the important changes this release stem from MSBuild’s transition into Visual Studio:

  • MSBuild and the VB/C# compilers are now available as a standalone package, Microsoft® Build Tools. This package is installed with Visual Studio 2013.

  • We are simplifying MSBuild’s versioning story. Each version of Visual Studio will have a corresponding version of the Microsoft® Build Tools including MSBuild, the VB/C# compilers, and common tasks and targets that make up the 2013 Toolset. There will no longer be any sub Toolset versions. Visual Studio 2013 will exclusively use 2013 MSBuild and VB/C# compilers (assembly version 12.0) and the 2013 Toolset (ToolsVersion 12.0).

  • The way MSBuild selects Toolset versions for command line builds is now identical to the way Visual Studio builds projects. If your projects build in VS, they will build from the command line. No more manually overriding Toolset versions and hunting down missing dependencies.

  • MSBuild has a dependency on the latest Framework, .NET 4.5.1.

MSBuild is now part of Visual Studio!

MSBuild’s New Binaries Location

Shipping MSBuild separately from the .NET Framework required us to relocate MSBuild and the VB/C# compilers.

On 32-bit machines they can be found in: C:\Program Files\MSBuild\12.0\bin

On 64-bit machines the 32-bit tools will be under: C:\Program Files (x86)\MSBuild\12.0\bin

and the 64-bit tools under: C:\Program Files (x86)\MSBuild\12.0\bin\amd64

MSBuild is now part of Visual Studio!

MSBuild の場所が上記の場所に変わり、Microsoft.Build.Tasks.v12.0.dll が見つけれられない。空白が処理できないようで "" も利かない。

3 Conclusion

諦めること。以下の環境変数 PATH を設定する。

C:\Program Files (x86)\MSBuild\12.0\Bin\



Amazon アソシエイト