0
votes

Using teamcity to do builds on a VS2013 solution, on Server 2012.

I added a codedUITest project to the solution.

For some reason build agent A works and B and C do not.

I cannot find any differences between the servers. The installs are all the same and the files all appear to be there.

I get the following error.

CoreCompile Csc CodedUITest1.cs(7, 40): error CS0234: The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) CodedUITest1.cs(9, 40): error CS0234: The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) CodedUITest1.cs(10, 51): error CS0234: The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) CodedUITest1.cs(18, 6): error CS0616: 'CodedUITest' is not an attribute class Project CodedUITest\CodedUITest.csproj failed.

On agent A it generates this (WORKS!! and references are included)

C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.TestTools.UITest.Common.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.TestTools.UITest.Extension.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.TestTools.UITesting.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.Drawing.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.Windows.Forms.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\UiaComWrapper.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\WindowsBase.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\CodedUITest.dll /subsystemversion:6.00 /target:library /utf8output CodedUITest1.cs Properties\AssemblyInfo.cs "D:\BuildAgent\temp\buildTmp.NETFramework,Version=v4.5.1.AssemblyAttributes.cs"

On the others it generates (DOES NOT WORK. NOTICE THE MISSING DEPENDENCIES. BOOO!)

C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.Drawing.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.Windows.Forms.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\WindowsBase.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\CodedUITest.dll /subsystemversion:6.00 /target:library /utf8output CodedUITest1.cs Properties\AssemblyInfo.cs "D:\BuildAgent\temp\buildTmp.NETFramework,Version=v4.5.1.AssemblyAttributes.cs"

Any ideas?

Thanks!

1
I have run into similar issue and decided to resolve this by managing the Microsoft Test assemblies myself in source control and referencing them there. If you generate a Diagnostic MSBuild log, you should see how the assemblies are searched for and fail.JohnZaj
Still no idea why. Servers all appear to be identical. The verbose log doesn't show anything other than not linking the libraries which is obviously already known.William

1 Answers

0
votes

To solve the problem for the failing compilation for test projects (your Agent A) you can remove Test projects from the "Release" build configuration. In Visual Studio, menu Build -> Configuration manager. Select "Release" for "Active solution configuration" and remove check in "Build" column for your "Test" projects. Close and save "all" (the .sln file changed).

This should make your build step working in TeamCity (it works for me).

I've no idea for the different behavior of your Agents.