Can't run or debug tests in current context - by Andrew Ritz

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 745762 Comments
Status Closed Workarounds
Type Bug Repros 10
Opened 6/1/2012 8:50:28 AM
Access Restriction Public


The ability to run or debug a test in the "current" context no longer works.  For projects that have hundreds of tests, this feature is very useful.  Now we are stuck with having to dig around in the unit test explorer window to find what we are looking for, which is a pain for single tests.
Sign in to post a comment.
Posted by Piranhasaurus Rex on 5/21/2013 at 10:45 AM
The old shortcut is linked to a command that is no longer valid. I had headaches around this too (why is it still in the list if it's not going to do anything?).

At any rate, "TestExplorer.RunAllTestsInContext" does work exactly as the old command did, and simply changing the shortcut to refer to the new command is sufficient.
Posted by Tim Murphy 26tp on 2/21/2013 at 7:46 PM
To be clear this problem has not been fixed in Visual Studio 2012 Web Express with Update 2.
Posted by Tim Murphy 26tp on 2/21/2013 at 7:46 PM
When will this be fixed? The Test Explorer to run a test, or tests, you have just written is so unproductive.

The workaround does not work for me.
Posted by Mark.Smith on 12/3/2012 at 6:29 AM
I downloaded the "Visual Studio 2012 Update 1" last night and started having this problem again. Was there a regression on this, if so then the Update 1 is a non starter for my work machine. In particular the Run test in context failed within a single test method saying the command was not available.
Posted by McKaySalisbury on 11/20/2012 at 11:07 AM
The ability to run or debug a *class* in current context doesn't works. Test context works, but Class context does not. (Neither does namespace)
Posted by Andrew Ritz on 8/23/2012 at 6:35 AM
Yes, you are correct. However, the original commands are still broken which is what this bug is about. I was mislead because the MS staff never bothered to mention that the 'fix' was to use a different command. Anyway, thanks for pointing this out, it is appreciated. Too bad I went off and found a better test framework and runner in the meantime.. =(
Posted by hugheshilton on 8/17/2012 at 10:09 AM
Actually, it does work in the RTM. There is no longer a "Run tests in current context" or "Debug tests in current context". There is just a "Run Tests" and "Debug Tests" but they work exactly the same way as the old commands. If you right click within the body of a single test and select "Run Tests" it will run just that test now (as opposed to running all the tests in the class which was the behavior in the RC). If you click outside the method body but within the test class and select "Run Tests" it will run all the tests in that test class. This seems to be working just fine to me and works for running a single test from code, which was the previous complaint.
Posted by Andrew Ritz on 8/15/2012 at 12:36 PM
Hey, guess what! I just installed the RTM release and the feature is still broken! Way to go Microsoft + Visual Studio team!
Posted by Andrew Ritz on 7/18/2012 at 5:42 AM
You say its fixed, but three updates later, and this feature is still broken. I am getting the impression that there is no actual plan to restore the feature. What is the problem?
Posted by Microsoft on 7/10/2012 at 2:13 PM
To clarify. This fix will show up in the RTM and GA releases, not the RC. Sorry for the confusion.

Joshua Weber
Posted by Mark.Smith on 7/3/2012 at 4:13 PM
I still have the same issue with the July update which I would imagine was the next public release you were mentioning although I can run tests in context now that I have the July update. However run tests in context runs all the tests in the file instead of the test that is currently selected.

Mark Smith
Posted by Mathew Aniyan MSFT on 6/28/2012 at 4:27 AM
We have fixed all the additional test commands. The bug has been resolved and verified. This fix will be available in the next public release.

Mathew Aniyan
Program Manager - Visual Studio ALM.
Posted by Microsoft on 6/7/2012 at 7:27 AM

After continuing to investigate this bug we've found additional test commands that need to be corrected, so I've reactivated the bug. We will fix this in time for the next public release. Thanks for your feedback and for helping us to make the unit test feature better.

Ian Bavey
Posted by Microsoft on 6/4/2012 at 10:10 AM

We have fixed this problem in the latest builds and you will be able to run and debug individual tests from within the code editor in the next public release of Visual Studio.

Ian Bavey
Posted by Microsoft on 6/4/2012 at 1:26 AM
Thank you for submitting feedback on Visual Studio 11 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by markoueis on 6/1/2012 at 12:59 PM
This is still not fixed in VS 2012 RC.
Posted by MS-Moderator01 on 6/1/2012 at 9:43 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(