Visual Studio Test Explorer window will not open

2019-06-14 21:38发布

问题:

For some reason I can't open the test explorer window in Visual Studio 2012. I click Test->Windows->Test Explorer and nothing happens...

This problem may have been caused by recently uninstalling DotCover. I did this because my licence expired and I was having issues running tests without it (context menus weren't working).

Any suggestions or advice much appreciated!

Thanks.

回答1:

In VS2012, Test Explorer has a bug in that the window doesn't get focus when you click Test > Windows > Test Explorer. Instead, the menu item has no effect unless the window was complete hidden, in which case it is displayed.

The bug means that if Test Explorer is collapsed with Auto Hide, the menu item does nothing. Check that Test Explorer isn't in an auto-hide tab somewhere off to the left or right (i.e. in a tab with text written vertically, like Server Explorer and Toolbox are by default).

Update: The bug is fixed in VS2013.



回答2:

Window -> Reset Window Layout fixed the problem for me.



回答3:

Found this solution here, which is the only thing that worked for me.

Delete all files from this folder: user\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache



回答4:

For me the fix was:

  • Focus on the test window by Test > Windows > TestExplorer
  • Using Win+Left / Right to move the window onto an active screen

    >    ┌┬┐
    > Win├┼┤ + Left or Right key
    >    └┴┘
    

The same worked for the ReSharper Unit Test Sessions window.



回答5:

As a brutal fix I actually decided to reset all VS settings (not ideal as you lose all your custom settings like formatting and debugging preferences!).

To do this open up a cmd line and cd to the VS directory (mine was C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE) and type:

devenv.exe /ResetSettings

Hope this helps someone in the future...



回答6:

This worked for me (VS2015):

  1. Close VS instances.

  2. Delete component model cache folder %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache . This wipes out the MEF cache.

  3. Run 'devenv /setup /ResetSkipPkgs ' ref. http://msdn.microsoft.com/en-US/library/ex6a2fad(v=VS.80).aspx

  4. Start VS again and see if the problem goes away.

Source



回答7:

I had the same problem; turned out it was the Corbis Route add-in that was causing an error in combination with the 'I hate regions' add-on, which caused the Test Window to throw an exception.

After removing both add-ins the window reappeared again after a reset of the VS 2013 window layout. (Windows > Reset Window Layout)



回答8:

A short-cut for those who have lost Test Explorer somewhere !

  1. Ctrl + Q (for quick launch)
  2. You would notice the focus on a small text box on the top right of VS.
  3. Type in "Test Explorer" and select the option that says Test> Windows> Test Explorer


回答9:

I have VS 2015. I couldn't find my Test Explorer, even with Test->Windows->Test Explorer. I finally figured it was showing on the left instead of the right.