Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading VS2015 solution in VS2017, coded UI test references are not found

I opened our solution in Visual Studio 2017 but some testing references aren't found, specifically:

  • Microsoft.VisualStudio.QualityTools.CodedUITestFramework
  • Microsoft.VisualStudio.TestTools.UITest.Common
  • Microsoft.VisualStudio.TestTools.UITesting

Opening under VS2015 they load fine and I can see the references under the Visual Studio 2015 folder structure "Microsoft Visual Studio 14.0\Common7\IDE\PublicAssemblies\".

However they don't appear under the 2017 installed files: "\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies\".

How can I get VS to pick up these references, am I missing a plug-in or extension? Have they been consolidated or deprecated?

Microsoft Visual Studio Enterprise 2017 Version 15.0.26228.4 D15RTWSVC

Microsoft .NET Framework Version 4.6.01055

like image 694
bucktronic Avatar asked Mar 14 '17 12:03

bucktronic


Video Answer


1 Answers

If you are running VS 2017 Enterprise then you can use this solution to add Coded UI Test back. https://stackoverflow.com/a/42788766/2563765

If you want to remove those references in your project because you are not using Coded UI Test anymore, you can

1) Unload your project

2) Edit the .csproj file

3) Find

<IsCodedUITest>True</IsCodedUITest>
<TestProjectType>CodedUITest</TestProjectType>

   and repleace with

<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>

4) Remove

<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' Or '$(VisualStudioVersion)' == '11.0'">
  <ItemGroup>
    <Reference Include="UIAutomationTypes" />
  </ItemGroup>
</When>
</Choose>

   and

<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
  <ItemGroup>
    <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <Private>False</Private>
    </Reference>
    <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <Private>False</Private>
    </Reference>
    <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <Private>False</Private>
    </Reference>
    <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <Private>False</Private>
    </Reference>
  </ItemGroup>
</When>
</Choose>

   if found

5) Reload the project

like image 170
Steven Avatar answered Oct 23 '22 08:10

Steven