Scenario:
1. create a project B contain the CodedUI test.
2. create a project A which is "ConsoleApplication". It has a reference to project B.
Problem:
When do debugging on project B, there is some problem showing as below:
1. Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITest.Playback"
2. Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITesting"
3. When running go into "Codeduitestmethod", there is a "Nullreferenceexception" on Mouse.click()
solution:
Add reference on below Dlls:
Microsoft.VisualStudio.TestTools.UITesting.dll
Microsoft.VisualStudio.TestTools.UITest.Playback.dll
Microsoft.VisualStudio.TestTools.UITest.Framework.dll
Microsoft.VisualStudio.TestTools.UITest.Extension.Uia.dll
Microsoft.VisualStudio.TestTools.UITest.Extension.MSAA.dll
Microsoft.VisualStudio.TestTools.UITest.Extension.IE.dll
Microsoft.VisualStudio.TestTools.UITest.Extension.dll
Microsoft.VisualStudio.TestTools.UITest.Common.dll
Microsoft.VisualStudio.TestTools.UITest.CodeGeneration.dll
Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll
And, use playback.initial() outside "CodeduiTestMethod".