I use Bamboo to build my SSDT database solution using VS2012. 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?)
Bamboo always runs msbuilds from this location: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
I noticed that whenever build fails the msbuild.exe output is this:
Microsoft (R) Build Engine version 4.0.30319.18408
[Microsoft .NET Framework, version 4.0.30319.18449]
but when build succeed then output is this:
Microsoft (R) Build Engine version 4.0.30319.34209
[Microsoft .NET Framework, version 4.0.30319.34209]
I don't know where is it taking version 4.0.30319.18408 from. I searched whole disk for msbuild.exe and executed everyone and none of them has version 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.
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.
EDIT: Components list is scripted with PowerShell. I just noticed that actual list in Programs and Features is shorter. There is only one Visual Studio 2012 Professional.