1

I have a newly created coded UI test project that I checked into TFS. When it tries to build it fails and I have these two errors:

The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)

and

The type or namespace name 'Extension' does not exist in the namespace 'Microsoft.VisualStudio.TestTools.UITest' (are you missing an assembly reference?)

I have followed some of the other advice I've seen to no avail. I've created a folder in the project and copied the UI test assemblies there and changed the reference, I set Copy Local to true, and I verified that these new assemblies were checked in and on the server... but I still am getting the same exact errors.

I'm out of ideas, thoughts?

UPDATE I received remote access to the server; I opened a copy of VS 2015 and compiled, ran into the same errors. It is missing references to the coded ui dlls, so I re-added and compiled successfully. I then saved the project but as soon as someone checks in new code to TFS, the references are gone again.

So now I don't understand why the references are there in my local environment, but are removed when checked in. What am I missing here?

Omni
  • 327
  • 1
  • 5
  • 17
  • Where is the build being done? Does that computer have a Visual Studio that supports Coded UI installed, or does it have the DLLs required? You might find some of the Q&As here about running Coded UI from a console or standalone application relevant. – AdrianHHH Dec 22 '16 at 12:46
  • The build is being done on a TFS 2015 server that has a copy of VS 2015 on it. Based on that I thought it would have the dlls but I was getting the missing reference errors so I copied them to a folder inside the project to guarantee they would be found, no luck however. – Omni Dec 22 '16 at 13:24
  • Which VS2015? Is it one that supports Coded UI? – AdrianHHH Dec 22 '16 at 13:52
  • It's the enterprise version. – Omni Dec 22 '16 at 14:00
  • See if this helps! https://social.msdn.microsoft.com/Forums/vstudio/en-US/2373b3ee-da10-4f4e-9e7a-995ae820c4c3/build-agent-problems-missing-assembly-references?forum=tfsbuild – Prageeth Saravanan Dec 22 '16 at 14:09
  • I've tried that with no success. I left the dll names I copied to the project folder the same, could this cause I conflict? Maybe I should rename them just to be sure. – Omni Dec 22 '16 at 14:45
  • How's the result when you run the project locally? – Cece Dong - MSFT Dec 23 '16 at 06:55
  • What do you mean copy of VS 2015? Is it installed via exe/msi file or just copy VS 2015 folder from another machine? Could you open that Coded UI Test project in VS 2015 on your TFS 2015 server and run? – starian chen-MSFT Dec 26 '16 at 05:56
  • It compiles and runs fine locally, just when TFS tries to compile I see the errors. And by copy I meant it has it's own installation of VS 2015 installed. – Omni Dec 27 '16 at 11:44
  • Does locally mean on TFS build agent? If not, try it on TFS build agent machine. What're detail build steps of your build definition? – starian chen-MSFT Dec 28 '16 at 06:17
  • The build steps are: Visual Studio Build | Visual Studio Test | Index Sources & Publish Symbols | Copy Files | Publish Build Artifacts – Omni Dec 28 '16 at 18:57
  • Does locally mean on TFS build agent? – starian chen-MSFT Jan 02 '17 at 05:22
  • No, it means on my laptop, not on the server. Sorry for the confusion. – Omni Jan 12 '17 at 14:16
  • Also, it does not compile on the server (same errors). The references for the Coded UI stuff is missing (as in not listed, not "could not find"). I can't add them manually on the server, it says access denied. – Omni Jan 12 '17 at 14:19

2 Answers2

1

Ok I finally discovered that for some reason the reference paths were pointing to an incorrect drive on TFS. I have no idea why but once I changed the drive, it compiles and builds successfully.

Omni
  • 327
  • 1
  • 5
  • 17
0

Check whether you have added the following references to your project:

Microsoft.VisualStudio.QualityTools.CodedUITestFramework

Microsoft.VisualStudio.TestTools.UITest.Common

Microsoft.VisualStudio.TestTools.UITest.Extension

Microsoft.VisualStudio.TestTools.UITesting
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • The references are there, the project compiles and runs locally just fine. – Omni Dec 27 '16 at 11:42
  • @Omni, try to build your project that TFS has got on your build agent machine, and check the result. – Cece Dong - MSFT Dec 28 '16 at 06:23
  • it does not compile on the server (same errors). The references for the Coded UI dlls are missing (as in not listed, not "could not find"). I can't add them manually on the server, it says access denied. – Omni Jan 12 '17 at 14:19