I am getting following error in my C# visual studio project:
The type or namespace name \'VisualStudio\' does not exist in the namespace \'Microsoft\'
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:
Add a reference to 'Microsoft.VisualStudio.QualityTools.UnitTestFramework" NuGet packet and it should successfully build it.
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.
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.
To resolve this issue, I had to do the following:
Once the DLLs are installed, you can add references to them using the method that Agent007 indicated in his answer.
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.