Question

All of my unit tests have disappeared suddenly in Visual Studio 2013 and I can not seem to get them to be discovered in the Test Explorer.

We use visual studio 2010 as our primary environment. I have Visual Studio 2013 Express Desktop installed as my editor of choice, work in it, then do final build/check-in with 2010. Everything works fine in 2010. But 2013 express will not discover tests anymore. It used to, then in the middle of working a change it stopped. These are mstest tests.

I get the following Tests output:

------ Discover test started ------
TestTypes\13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b could not be loaded because the TIP could not be instantiated for the following reason(s): System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Tip, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Tip, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Microsoft.VisualStudio.TestTools.TestManagement.TipDelayLoader.LoadTip()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

========== Discover test finished: 0 found (0:00:00.1640164) ==========

Steps attempted to fix:

  • Checked out fresh copy of source from the repository
  • Verify other developers do not have this problem (their 2013 installs find tests)
  • Repair 2013
  • Remove 2013, reboot, install 2013
  • Created new WPF project and added test (that test discovered, but problem not solved)

Any suggestions would be appreciated. My next step is to wipe the system, but that will be painful.

Était-ce utile?

La solution 2

I have fixed this problem indirectly by doing the following:

  • Added a new empty class called Testable
  • Added a new unit test to test it

(at this point all my old unit tests showed back up, along with the new one)

  • Reverted all changes back to what is checked in

(old unit tests still discovered)

It seems like something not-in-my-code was causing a problem, and adding a new unit test fixed it. Doesn't say why it was happening, but if you run into the problem this procedure may fix it for you.

Autres conseils

Are you using nUnit? I've just had a similar situation moving to a new pc, causing all existing tests to disappear.

Go to Tools -> Extensions and updates -> Select Online on the left -> enter in the search box top right 'nunit test adapter' and install it.

Restart Visual Studio.

One rebuild later and the tests appeared again.

Had the exact same issue!

In our solution we had tree files:

  • Local.testsettings
  • LocalTestRun.testrunconfig
  • TraceAndTestImpact.testsettings

Made a backup of these files, removed them and started the solution without them. Built and found the files. Then moved back the files, and it still workes...

This cost us about two days troubleshooting. If you have the same problem it might be worth a try.

Anytime when you have problem with the Google test runner i prefer you to try run the project as exe, i had the same problem and when i ran it with command line i found out that some dll that i using is missing in my execute folder.

  1. if you have any dlls you use in your project, verify that they are in you execute folder (or GAC)
  2. try to run the gtest project by exe (command line) you will get informative error massage instead of tests disappearing .

I know this question is old, but I had the same problem where some of my tests stopped showing up in VS 2013 with NUnit 3.

My tests were not showing up because I implemented IFormattable on a class, and all the tests for that class disappeared after I rebuilt the project. I used the default implementation code for the IFormattable interface generated by Visual Studio, which throws a NotImplementedException in the generated method. It turns out, when the ToString method for a class throws and exception, the NUnit test runner will not display any of the tests. After I implemented the ToString method properly, all the tests started displaying like they should.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top