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

bucktronic
  • 3,027
  • 2
  • 22
  • 27
  • 1
    I got an answer for my similar question yesterday: http://stackoverflow.com/questions/42788695/requirements-for-creating-a-new-coded-ui-testing-project-in-vs2017-enterprise – SalamiArmy Mar 15 '17 at 14:12

1 Answers1

12

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

Community
  • 1
  • 1
Steven
  • 2,258
  • 1
  • 22
  • 22
  • 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. – magicandre1981 May 03 '18 at 14:53
  • 1
    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. – Steven May 04 '18 at 15:02
  • 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? – magicandre1981 May 04 '18 at 20:08