[英]Bamboo randomly runs different version of msbuild.exe and build fails
I use Bamboo to build my SSDT database solution using VS2012. 我使用Bamboo通过VS2012构建我的SSDT数据库解决方案。 The problem began when I added database unit test project to the solution. 当我将数据库单元测试项目添加到解决方案中时,问题就开始了。 It is random that sometimes build fails with message: 有时构建失败并显示以下消息是随机的:
error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 错误CS0234:类型或名称空间名称“ VisualStudio”在名称空间“ Microsoft”中不存在(您是否缺少程序集引用?)
Bamboo always runs msbuilds from this location: C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\MSBuild.exe Bamboo始终从以下位置运行msbuild:C:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ MSBuild.exe
I noticed that whenever build fails the msbuild.exe output is this: 我注意到, 只要构建失败 ,msbuild.exe的输出就是这样的:
Microsoft (R) Build Engine version 4.0.30319.18408 Microsoft(R)Build Engine版本4.0.30319.18408
[Microsoft .NET Framework, version 4.0.30319.18449] [Microsoft .NET Framework版本4.0.30319.18449]
but when build succeed then output is this: 但是当构建成功时,输出是这样的:
Microsoft (R) Build Engine version 4.0.30319.34209 Microsoft(R)Build Engine版本4.0.30319.34209
[Microsoft .NET Framework, version 4.0.30319.34209] [Microsoft .NET Framework版本4.0.30319.34209]
I don't know where is it taking version 4.0.30319.18408 from. 我不知道从哪里获取4.0.30319.18408版本。 I searched whole disk for msbuild.exe and executed everyone and none of them has version 4.0.30319.18408. 我在整个磁盘上搜索了msbuild.exe并执行了所有人,但没有一个版本为4.0.30319.18408。
I need an advice how to force Bamboo to run correct version of msbuild.exe or how to uninstall version 4.0.30319.18408. 我需要有关如何强制Bamboo运行正确版本的msbuild.exe或如何卸载4.0.30319.18408的建议。
Components on the build machine are following: 构建机器上的组件如下:
Microsoft .NET Framework 4 Multi-Targeting Pack 4.0.30319
Microsoft .NET Framework 4.5 Multi-Targeting Pack 4.5.50709
Microsoft .NET Framework 4.5 SDK 4.5.50710
Microsoft .NET Framework 4.5.2 Multi-Targeting Pack 4.5.51651
Microsoft .NET Framework 4.5.2 Multi-Targeting Pack (ENU) 4.5.51209
Microsoft Visual Studio 2010 Shell (Integrated) - ENU 10.0.40219
Microsoft Visual Studio 2010 Shell (Isolated) - ENU 10.0.40219
Microsoft Visual Studio 2012 Devenv 11.0.50727
Microsoft Visual Studio 2012 Devenv Resources 11.0.50727
Microsoft Visual Studio 2012 Performance Collection Tools 11.0.50727
Microsoft Visual Studio 2012 Performance Collection Tools - ENU 11.0.50727
Microsoft Visual Studio 2012 Preparation 11.0.50727
Microsoft Visual Studio 2012 Shell (Minimum) 11.0.50727
Microsoft Visual Studio 2012 Shell (Minimum) Interop Assemblies 11.0.50727
Microsoft Visual Studio 2012 Shell (Minimum) Resources 11.0.50727
Microsoft Visual Studio 2012 Tools for SQL Server Compact 4.0 SP1 ENU 4.0.8876.1
Microsoft Visual Studio Professional 2012 11.0.50727
Microsoft Visual Studio Professional 2012 - ENU 11.0.50727
Microsoft SQL Server Data Tools – Database Projects – Web installer... 10.3.20116.0
Microsoft SQL Server Data Tools - enu (11.1.50318.0) 11.1.50318.0
Microsoft SQL Server Data Tools Build Utilities - enu (11.1.40403.0) 11.1.40403.0
There is no msbuild in the PATH. PATH中没有msbuild。
EDIT: Components list is scripted with PowerShell. 编辑:组件列表使用PowerShell编写脚本。 I just noticed that actual list in Programs and Features is shorter. 我只是注意到“程序和功能”中的实际列表较短。 There is only one Visual Studio 2012 Professional. 只有一个Visual Studio 2012 Professional。
I modified Bamboo task not to call msbuild executable but to run such script: 我修改了Bamboo任务以不调用msbuild可执行文件,而是运行以下脚本:
ECHO Setting variables
CALL "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat"
ECHO Starting msbuild.exe
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe .\SVN_CHECKOUT\Databases\Databases.sln /fileLoggerParameters:LogFile=".\msbuild.log.txt" /p:Configuration=Release /consoleloggerparameters:ErrorsOnly;Verbosity=quiet;Summary /m
So far it works. 到目前为止,它仍然有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.