我正在尝试在 VS2012 项目中使用这样的程序集:
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
但是我在测试中得到了一堆红色:
即使使用这种红色,我也可以在本地构建和运行,但如果可能的话,我想解决这些问题。我的构建机器拒绝这个并出现以下错误:
DashboardTest.cs (7): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
DashboardTest.cs (9): The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
UIMap.cs (9): The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
UIMap.cs (10): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
UIMap.Designer.cs (19): The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
UIMap.Designer.cs (20): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
UIMap.Designer.cs (132): The type or namespace name 'BrowserWindow' could not be found (are you missing a using directive or an assembly reference?)
DashboardTest.cs (10): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
UIMap.cs (12): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
UIMap.cs (13): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
UIMap.Designer.cs (22): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
UIMap.Designer.cs (23): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
DashboardTest.cs (18): The type or namespace name 'CodedUITest' could not be found (are you missing a using directive or an assembly reference?)
DashboardTest.cs (18): The type or namespace name 'CodedUITestAttribute' could not be found (are you missing a using directive or an assembly reference?)
有小费吗?我的测试项目中的所有引用都设置为复制 local = true。
更新 - 我通过添加对 visualStudio.TestTools.UITesting 的引用使引用在本地工作,但 CodedUITest 属性仍然是红色的,并且构建仍然失败并出现相同的错误。