Visual Studio – Error The type or namespace name ‘CodedUITest’ could not be found

If you are trying to build some code with Visual Studio 2010 and get build errors like this:

 

The type or namespace name ‘CodedUITest’ could not be found …

 

Then it is probably because you are building with an edition of Visual Studio that is not Premium or Ultimate – the professional edition does not have the UI Test Tools built in.

 

If you are lucky you will be able to just remove the offending test project(s) with the broken references from the solution and build the rest – typically it will be only the test projects that won’t build.

 

To do this, choose the Build / Configuration manager… menu and un-check under the ‘Build’ column for any test projects that aren’t building.

 

Or shell out for an upgrade of Visual Studio!