Monday, September 28, 2015

TestClass could not be found -- or -- cannot find Microsoft.VisualStudio.TestTools.UnitTesting

Problem
Severity Code Description Project File Line
Error CS0246 The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?)


And other errors having to do with not being able to find things in the Microsoft.VisualStudio.TestTools.UnitTesting namespace.

This started happening to me after I upgraded from VS2013 to VS2015 Community.

To troubleshoot, I created a new unit test project to see what reference that would have. It has a reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll, which is located here:
<driveletter>:\VisualStudioCommunity\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll

Solution
1. Remove the current reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
2. Add reference to <driveletter>:\VisualStudioCommunity\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll



No comments:

Post a Comment

There was an error in this gadget