I converted a VS2008 solution that contains some unit testing projects to VS2010. After the conversion I tried to compile the solution, but I'm getting the following error:
The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
The namespace declaration cannot be found using Microsoft.VisualStudio.TestTools.UnitTesting;
. In addition, I couldn't find the Microsoft.VisualStudio.QualityTools.UnitTestFramework assembly when I tried to add a new project reference.
Does anyone know what I'm doing wrong?
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).
Test Automation Framework: Microsoft has its Unit Testing Framework implemented in a namespace which is Microsoft. VisualStudio. TestTools.
Uniform app-platform support – MSTestV2 is a converged implementation that offers uniform app-platform support across . NET Framework, . NET Core, ASP.NET Core, and UWP. Read more. The implementation is fully cross platform (Windows, Linux, Mac).
TestInitialize and TestCleanup are ran before and after each test, this is to ensure that no tests are coupled. If you want to run methods before and after ALL tests, decorate relevant methods with the ClassInitialize and ClassCleanup attributes.
It's called Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
.
You can find it in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
.
I just had this problem as well, and with a Microsoft.Data.Schema library as well. The answer is correct, in that these library are on the machine and in the VS 10.0 directory.
The problem (at least for me) was that the solution was converted from VS2008 and the conversion utility targetted the project for .NET 3.5. Since the 10.0 library require .NET 4.0 they are not picked up by the compiler.
The solution is to either revert to use VS2008 where these resolve correctly; or to switch the project to compile for .NET 4.0 so you can use the available libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With