I just added the Microsoft.VisualStudio.TestTools.UITesting link in my project, and I'm trying to use the ImageComparer` class, but I get an error when starting this
private void Form1_Load(object sender, EventArgs e) { Image a = Image.FromFile(@"C:\Users\itapi\Desktop\a.png"); Image b = Image.FromFile(@"C:\Users\itapi\Desktop\b.png"); ImageComparer.Compare(a,b); }
error
An unhandled exception of type 'System.TypeInitializationException' occurred in Microsoft.VisualStudio.TestTools.UITesting.dll
Additional Information: The type initializer for 'Microsoft.VisualStudio.TestTools.UITest.Extension.UITestUtilities' threw an exception.
Does anyone know what's wrong here?
this is the main process
System.TypeInitializationException: type initializer for 'Microsoft.VisualStudio.TestTools.UITest.Extension.UITestUtilities' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly "Microsoft.VisualStudio.TestTools.UITest.WindowsStoreUtility, Version = 12.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a 'or one of its dependencies. The system cannot find the specified file.
in Microsoft.VisualStudio.TestTools.UITest.Extension.UITestUtilities..cctor () --- The end of the internal trace of the exception stack is in Microsoft.VisualStudio.TestTools.UITest.Extension.UITestUtilities.CheckForNull (Object parameter, String parameterName) in Microsoft. VisualStudio.TestTools.UITesting.ImageComparer.CompareInternal (Image actualImageComparer.OutputImageComparer.OutputImageComparer.OutimageFrequently .VisualStudio.TestTools.UITesting.ImageComparer.Compare (Image actualImage, Image expectedImage) in WindowsFormsApplication4.Form1.Form1_Load (object sender, EventArgs e) in c: \ Users \ itapi \ OneDrive \ ?????? \ Visual Studio 2013 \ Projects \ WindowsFormsApplication4 \ W indowsFormsApplication4 \ Form1.cs: line 30
user3548681
source share