Visual Studio 2005 Team Suite Unit Testing Note
In case anyone else is having this problem and cannot find a solution:
I just created a new unit testing project with Visual Studio, using C#. The skeleton program it creates looks simple enough. The skeleton code that was generated for me has these 4 namespace includes:
using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Without changing anything in the code or project, I attempted to build it, I got these errors:
error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?)
This is weird since a skeleton project should just build. I searched online for these errors and found NO ONE posting the same problem. Hoping to just simply be able to add a reference to the project, I looked for any DLL files on my system named “Microsoft.VisualStudio.TestTools.UnitTesting.dll” or similar and found nothing. I looked in the built-in list of .Net namespaces and could not find it either.
Solution:
Searching for less similar named references, I happened to stumble upon the correct reference. It is a built-in .Net namespace reference, just not named “Microsoft.VisualStudio.TestTools.UnitTesting”, but rather: “Microsoft.VisualStudio.QualityTools.UnitTestFramework”. To add this to your unit test project, go to “Add Reference” and it should be listed under the .Net tab in the mix of other namespaces. When I added this to the references, the code compiled just fine, without modifying the namespace includes or anything.
As far as I know, unit testing is only available in Visual Studio 2005 Team Suite edition, but I have read it is also in Visual Studio 2005 for Team Testers edition.
Thanks! This solved it for me.
Hi Bill,
Just to tell that not you alone on the planet had this problem, i’ll leave a short post.
With your hint i was able to locate it in ..\assemble\GAC_MSIL – as it looks microsoft.VisualStudio is no longer installed with the silverlight studio tools (as for e.g. .VisualBasic is). Searching for microsoft.visualstudio.tools* i found 104 file-references, unfortunately the right one was not included.
This is – what i call – microsoft ASSEMBLY HELL …
Keep it up !!
macx .. visiting from Austria
thanks for the tip, the problem has just been fixed
Thanks a million, that was just what I needed!