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

1

8

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

Sandor answered 14/3, 2017 at 12:8 Comment(1)
I got an answer for my similar question yesterday: #42789195Amir
T
12

If you are running VS 2017 Enterprise then you can use this solution to add Coded UI Test back. https://mcmap.net/q/637067/-requirements-for-creating-a-new-coded-ui-testing-project-in-vs2017-enterprise

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

Telles answered 16/3, 2017 at 17:52 Comment(3)
I changed IsCodedUITest and TestProjectType but still have the issue, that the [CodedUiTest] Attribute is not detected. the references work fine and CodedUI is selected in VS2017 Ent setup.Mindimindless
This solution I posted only works when you don't have any coded UI test or willing to remove all coded UI tests. If you want to continue to use coded UI, please follow the link in the beginning of my answer.Telles
ok, I already have CodedUI component installed and when I use the old csproj format I can compile the test, but with the converted csproj the CodedUI Test can't be compiled. Is the new format not comaptible with CodedUI?Mindimindless

© 2022 - 2024 — McMap. All rights reserved.