Where to find “Microsoft.VisualStudio.TestTools.UnitTesting” missing dll?

后端 未结 12 1808
谎友^
谎友^ 2020-11-28 05:11

I am getting following error in my C# visual studio project:

The type or namespace name \'VisualStudio\' does not exist in the namespace \'Microsoft\'

相关标签:
12条回答
  • 2020-11-28 05:12

    You have to add reference to

    Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 
    

    It can be found at "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\" directory (for VS2010 professional or above; .NET Framework 4.0).

    or right click on your project and select: Add Reference... > .NET: or click Add Reference... > .NET:

    0 讨论(0)
  • 2020-11-28 05:14

    Add a reference to 'Microsoft.VisualStudio.QualityTools.UnitTestFramework" NuGet packet and it should successfully build it.

    0 讨论(0)
  • 2020-11-28 05:15

    There is also a nice nuget package. It will pull the dll to your packages folder. You will need to add the reference to the dll manually.

    NOTE: This package is not an official Microsoft package.

    0 讨论(0)
  • 2020-11-28 05:17

    I got this problem after moving a project and deleting it's packages folder. Nuget was showning that MSTest.TestAdapter and MSTest.TestFramework v 1.3.2 was installed. The fix seemed to be to open VS as administrator and build After that I was able to re-open and build without having admin priviledge.

    0 讨论(0)
  • 2020-11-28 05:22

    To resolve this issue, I had to do the following:

    1. Launch the Visual Studio Installer with administrative privileges
    2. If it prompts you to install updates to Visual Studio, do so before continuing
    3. When prompted, click the button to Modify the existing installation
    4. Click on the "Individual components" tab / header along the top
    5. Scroll down to the "Debugging and testing" section
    6. Check the box next to "Web performance and load testing tools"
    7. Click the Modify button on the bottom right corner of the dialog to install the missing DLLs

    Once the DLLs are installed, you can add references to them using the method that Agent007 indicated in his answer.

    0 讨论(0)
  • 2020-11-28 05:22

    If you came here because your VSTS build job is failing with the above error message. Ensure that you are using at least version 2.* of the nuget task to restore your packages.

    0 讨论(0)
提交回复
热议问题