Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My Visual Studio is missing Microsoft.VisualStudio.QualityTools.UnitTestFramework

I configured now a new computer. Installed VS 2010 and all necessary component, got my running project on that new computer..

Compiling the project shows me that VS 2010 cannot find the reference "Microsoft.VisualStudio.QualityTools.UnitTestFramework".

This assembly is located in Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies

But VS is not able to find it.

The used project is OK. It can be compiled on my old machine!

Edit: The error while compiling: error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

like image 552
Ferhat Avatar asked May 23 '11 07:05

Ferhat


3 Answers

Upgrade of some 2003 code for us was resolved through the following:

  1. Removing the existing broken reference
  2. Updating the project from .Net 3.5 to .Net 4 (not the client version)
  3. Adding the new one from VS2010 OR VS2012

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll

The existing "USING" statement worked without change. "using Microsoft.VisualStudio.TestTools.UnitTesting;"

like image 61
Mike Avatar answered Nov 16 '22 19:11

Mike


Check that your project is not marked for X64 platform in a mixed solution configuration (right click the solution -> Configuration Manager option). After changing the platform for the test project from X64 to Any CPU the assemblies were recognized and it worked.

like image 2
sasha Avatar answered Nov 16 '22 19:11

sasha


I had the same problem.

Old machine:
    Windows XP, 32 bit
    VS 2010 (32 bit)

New machine:
    Windows 7, 64 bit
    VS 2010 (32 bit)

I solved it by simply deleting the reference to Microsoft...UnitTestFramework, and adding the new one, which was here:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll

I did not need to change the target .NET framework version.

like image 4
Jeff Roe Avatar answered Nov 16 '22 18:11

Jeff Roe