1
votes

I'm trying to run a CodedUI-related test using xUnit instead of MsTest. This results in

Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITesting, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies

If I switch back to MsTest everything works fine.

Any thoughts?

1

1 Answers

0
votes

Check your References for Microsoft.VisualStudio.QualityTools.CodedUITestFramework, and also your using block for using Microsoft.VisualStudio.TestTools.UITesting;

If those don't exist, first add the using statement, then rebuild your solution. If you are still having the error, right click on References -> Add Reference. Then search for Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll. If it doesn't come up in the list, click Browse and navigate to where the .dll is located. For me it's C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll. Select the .dll -> click Add -> Ok, then rebuild your solution again.

If you create a solution with Unit Test Project (or anything other than CodedUI Test Project), then you need to add the .dll and using statement.