Originally posted on: http://geekswithblogs.net/Aligned/archive/2014/01/10/microsoft.visualstudio.testtools-versioning-problems.aspx
Our project was created in Visual Studio 2012 and now we have moved to 2013. The gated check in build kept giving me version errors, even though it built and ran fine locally and I had referenced version 12 (from version 11).
I tried editing the XML of the project, adding hintpaths, setting the set local to true and setting specific version, but kept getting this error.
Assembly ‘X.UITestFramework, Version=1.0.5122.28413, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.VisualStudio.TestTools.UITesting, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly
'Microsoft.VisualStudio.TestTools.UITesting, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I have 2 projects
UITestFramework which has helper methods for our Selenium UI tests which is c# class project and
UIAutomation which is a Coded UI test project with the test method.
The Coded UI test has a few interesting lines that the class project does not:
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
and at the bottom:
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
Notice the Version is set to 10.0. I should have changed that number to 12.0. That would be one way to fix it. However, I chose to remove these lines from the project xml and add the dlls manually from add reference from the C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\ folder.