Why does Visual Studio not hit breakpoint until second debug session? - visual-studio

When debugging a unit test through either the TEST menu or the right-click context menu, VS2013 always ignores the breakpoint in the unit test after making a code change to the current c# test class. Debugging a second time causes the breakpoint to be hit.

My suspicion is that this has to do with VS2013's new feature "Keep Test Execution Engine Running".
You can toggle that feature in Visual Studio's menu via "TEST - Test Settings".
You might also be able to specify that behaviour by using a runsettings file with KeepExecutorAliveAfterLegacyRun set to false: http://msdn.microsoft.com/en-us/library/vstudio/jj635153.aspx.

Related

Skip debug points - visual studio

I have a asp.net application. Some times I need to put many breakpoints. I know usage of F5, F10, F11 to navigate between line of code. If I want to bypass all the breakpoints for time being but want to keep all breakpoints alive for future, how can I do this?
Use Debug->Windows->Breakpoints window, you may disable (by using checkbox) or delete any/all breakpoints from there. You may also configure custom VS shortcut for this VS 2012 Add Shortcuts for "Disable all breakpoints" and "Enable all breakpoints"?.
Alternatively if you use local IIS you may run application without debugger attached, then if you want to start debugging use Debug->Attach to, select w3p.exe and start debugging (I use this setup often).

Express version missing Debug-> exceptions menu

I use. VS 2013 Express
When debugging, I need to stop automatically on exceptions.
try to follow this.
http://msdn.microsoft.com/en-us/library/d14azbfh.aspx#AddExceptionsCommand
It says I need to add Exceptions command to the Debug menu
On the Tools menu, click Customize.
The Customize dialog box appears.
Click the Commands tab and, in the Menu bar list, click Debug.
Click Add Command.
In Categories in the Add Command dialog box, click Debug.
In Commands, click Exceptions and then click OK.
But in stage 6, in Commands there is no Exeptions
Also I tried to remove Enable just my code, And it didn't work.
Just a FYI ---
Im am using VS Express 2010 (VB) and didn't see the debug exceptions.
Based on the screen shot above I just pushed CRLT-ALT-E and it opened.. (!)
Its a bit unclear to me, if VB 2010 Express has this option or not, or how to unhide it, but the key click combo opened it.
I was then able to turn off the option I needed
In my case the "PInvokeStackImbalance"
enter image description here
Another user has reported the missing 'exceptions' on the 'debug' menu to Microsoft and actually got an acknowlegement from Microsoft (though not from the product team and not confirmation that it is a bug).
https://connect.microsoft.com/VisualStudio/feedback/details/882780/exceptions-comman-missing-in-vs-2013-express-for-web
For what it's worth, you can add your vote to this report at that site; I'm experiencing this problem and I have done so too.
Here's a potential work-around: the 'exceptions' is present in the Visual Studio Express for Desktop. And you can install that edition side-by-side with Web edition. If you can figure out a way to invoke your project executable from the debugger in the Desktop edition, you'd have control over exceptions there.
The exceptions menu isn't shown in Visual Studio Web Developer Express. It is only shown in Visual C# Express.
You can however break on all exceptions. You can try to turn off "Just My Code" debugging, which will catch exceptions thrown in CLR code and linked libraries.
To do this, open Tools -> Options -> Debugging -> General, and uncheck "Just My Code" (or Enable Just My Code).
if it doesn't work try
Debug -> Exceptions -> Common Language Runtime Exceptions - check "when thrown"
if you don't see exceptions try to change your settings following this guide
Refer here for documentation.
update
if it still not working try this
Tools menu >> Import and Export Settings >> Reset all settings. Then choose C# Development Environment.
Many of the customization and integration features for Visual Studio's IDE are not available in the free Express editions, but you should be able to get to the Exceptions menu easily enough without using them.
Press F5 to start debugging, then select Debug / Exceptions... Turn on the check box for "C++ Exceptions" "Thrown". Hit "OK"

Run specific unit test in Visual Studio from the code window

I know I can click items in the test-explorers and run individual tests from there, but I would like to be able to right click or use a shortcut key to run the test of the method that has the current focus in the editor.
There doesn't appear to be a "run test" item available.
The best (but non-free) option is ReSharper:
Alternatives are:
NUnit Test Adapter (free)
TestDriven.Net (non-free)
NUnitForVS (free; Visual Studio 2008–2010 only)

Can I disable "debug view" in Visual Studio 2010?

Visual Studio 2010 switches to "debug view" when i click 'start debugging' - much like Eclipse does.
Can i disable this feature - if so how?
My machine doesn't perform very well - therefore the feature is irritating.
Besides with two monitors i don't need it.
Ctrl-F5 starts without debugging.
That's not what I meant, I would like to debug without the "debug view", i.e. without changing the layout of all windows.
You can change the layout of the windows in debug mode, but unfortunately, you cannot turn off the transition from "coding mode" to "debug mode". Your layout is persisted between debugging sessions, though, so any changes you make will remain.
Just click on Debug/Start without debugging from the menu or Ctrl-F5.
Just Press Control-F5

Visual studio 2005 "Object Test Bench" popup when debugging

When debugging a project in Visual Studio 2005, I have recently noticed a brief appearance of the "Object Test Bench" window. This window appears and then disappears after less than a second and does not look like the normal "Object Test Bench" window one sees when not debugging, as it looks like this:
alt text http://www.beok.co.il/images/ObjectTestBench.jpg
I would like to stop this window appearing and have tried the following:
Closing all Object Bench Test windows when not debugging
Resetting Visual Studio to default settings (devenv /ResetSettings)
Any other ideas?
Migrated? Hmm no code in this question. Anyway is the Object Test Bench perhaps open, but docked, so it pops up when the IDE state changes?
More info on the OTB on MSDN here :)
Edit: Here is what my VS 2005 OTB looks like.
alt text http://i.imagehost.org/0989/otb.gif
I also have the same problem. I once had JetBrain's Resharper 4.5 installed. I uninstalled it after my trial expired, and I think that's when I noticed the Object Test Bench popping up when I debug.
Did either/both of you have Resharper or any other Visual Studio add-on installed/uninstalled before this problem?
Related link on stackoverflow
I had what may be a similar problem: not just the Oject Test Bench, but also Breakpoint, Call Stack, and other windows popped up all over whenever I ran in Debug mode. It started during a project with a single page containing several (probably incompatible) jQuery scripts.
What worked for me was to click on Window -> "Auto Hide All", then again on Window -> "Reset Window Layout". That seemed to resolve it.
Go to on Window -> "Auto Hide All", after go on Window -> "Reset Window Layout". That will resolve the problem it.

Resources