While debugging in Visual Studio v16.3.2 I want to back on the previous breakpoint and I am trying to achieve it via Step Back Over button. Why this button always disabled?
The reason could be that it's disabled in your IDE.
Try
Tools > Options > IntelliTrace > General
and in there make sure that “IntelliTrace events and snapshots” is checked.
This might or might not require a restart of the IDE.
I am not sure if you are using correct configuration but link can help you setting.
Step Back Debugging
Other possible reason could be, is step back allowed on variable assignments?
Related
I'm using Visual Studio Community for Mac (2017), which is different from the one on Windows (it's a "rebranded version of MonoDevelop"). Specifically, I'm using it to write ASP.NET, C#, JS, and CSS but I think the warnings are only for C# code.
Every time I run my code, I am taken from the tab I was just in to another tab where I have a warning. I find this switching extremely disorienting, so I need it to stop.
I don't need or want to fix the problem causing the warning right now. I know I can go to "Options" > "Compiler", then set "Warnings level" to 0, but I don't want to not see a list of the warnings I have.
How can I prevent it from switching my current tab around?
After suffering with this for too long, I finally figured out the solution.
Simply check the checkbox next to the error in the list (in the "error pad"):
It will be shown (at least at first) in strikethrough and it won't steal your tab focus anymore (unless you uncheck it).
You can either do this for every warning or you can go to Preferences (shortcut: command + comma) and set a setting so that they automatically get checked off. The setting is "Build" > "Jump to first error or warning" and I set it to "Error" since I like being taken to any problem that prevents things from compiling. If you want it to never steal your tab focus, you should set it to "Never".
I'm in a Visual Studio debugging session, debugging a WinForms app, but I think this question applies to an ASP.Net code-behind debug session also. Let's say that I have lots of breakpoints set and I want to test a condition that requires running a setup test case first, then I want to run another test case that exercises the code again. The first time, I have to hit the Continue (F9) button 5 times to progress through the code breakpoints and finally arrive at the point where I'm prompted for input again. Now I want to input some data and I now want to carefully step through all the breakpoints.
Is there some way I can quickly push a button and tell the debugger to skip all those breakpoints during the setup test case entry and just progress to the next data input field? I know about the run to cursor capablilty, but that doesn't seem any easier than clicking thru all of the breakpoints.
I know this may sound trivial, but I find myself in this situation all the time.
I just want a super-continue button.
You can open the Breakpoints window (Debug -> Windows -> Breakpoints) and then you can select multiple breakpoints and disable or enable them as you go:
The best thing i can think of would be to create a condition on the breakpoint to only break when the data is set up.
E.g.
Or if all else fails, set a BreakPoint Hit Count, if you know it'll always be the 6th break that is relevant. E.g.
I have an MVC application which uses a silverlight control.
Somewhere along the line something is happening in the silverlight cs code that isn't right. I've inserted break points in the CS silverlight code to get a better idea of what's happening, but for some reason I just can't step through the code.
I know code is being hit, but it's just not showing me in the debugger.
I thought it might be because I was using Chrome as the default browser but I changed this to Internet Explorer and still no joy.
I realize this is a very vague question, but has anyone else experience anything similar, and if so, how did you get around it?
Any help would be appreciated,
Thanks.
Be sure to set the Silverlight Debugging checkbox on the project properties Web tab
If Chrome is your default browser and your breakpoint tooltip shows this message:
"The breakpoint will not currently be hit. No symbols have been loaded for this document"
... then it is possible the debugger attached to the wrong Chrome process at debug startup. A work-around is:
Start debugging your Silverlight app. Your app should be running in Chrome.
From the Debug menu, select Attach to Process...
Scroll through the available processes and locate the chrome.exe process that shows the type as 'Silverlight x86'.
Select that process and click Attach.
I had firefox as my default browser and nothing was being hit(I even tried attaching to a process). What finally worked for me was setting IE as the default.
Silverlight break points are now being hit for me! :)
Right Click on Web.UI project in solution. go to Web , check Debuggers --> Silverlight save and Debug..
Make sure you have silverlight developer installed.
Your code may be part of a class marked with the System.Diagnostics.DebuggerStepThroughAttribute. This happens with auto generated classes (like with Add Service Reference). If you are extending a partial class, other parts of the class definition may have that attribute.
Try unckecking the Options / Debugging / General / Enable Just My Code checkbox.
Otherwise put your mouse over the red dot in the source code window, which becomes an empty circle if the debugger disabled it, a tooltip will give you additional information.
I am getting the following error message while running .net 3.5 applciation
Your step-into request resulted in an automatic step-over of a
property or operator.
This behavior can be overridden in the context menu for the line being
executed by choosing 'Step Into Specific' or by unchecking the option
'Step over properties and operators'.
Do you want continue being notified when an automatic step-over
happens?
What does this error message mean?
VS2017 and VS2019:
Tools > Options > Debugging > Uncheck "Step over properties and operators > (Managed only)".
It is not an error message as such. The IDE is telling you that tracing for some of your code is being skipped during debugging due to the current settings. If you want to be able to trace into the code, change the settings as described in the message.
You can change this behavior by going to: Tools -> Option -> Debugging.
The setting for this in VS2010 is under: Tools -> Option -> Debugging (near the middle)
To be more specific: the option to enable in Visual Studio 2010 is:
Tools->Options->Debugging->General->Enable property evaluation and other implicit function calls
As answered by other people this is an informational message from Visual Studio telling you that it could have stepped into a line of code but rather stepped over it due to current dev environment settings.
There are three ways to change this behaviour in VS2012:
Change the settings: Tools->Options->Debugging->General->Step over properties and operators
OR
Right click on the line of code to get the context menu. Then untick: Step over properties and operators
OR
Select 'Step into Specific' in the right click context menu which will ask you which specific function you would like to step into. It will list all the properties/functions involved in the current source line.
In Visual Studio 2013: right click on the line that caused the message to pop-up.
This will bring up the context menu.
Uncheck the option: Step over properties and operators.
Other posts have the correct answer, which state that you can change the option in Tools > Options > Debugging > Step over properties and operators (Managed only) in Visual Studio. I wanted to add an image from the Options dialog for those who are visual. Uncheck the property if you want to perform Step Into (F11) without automatic Step Over (F10).
The reason that we get this prompt is: that we may have created properties or operators in our classes, and when, during debugging, we reach that line of code, it is stepped over (like the effect of F10 ) instead of stepping into ( the actual effect of F11 )
e.g., this line of code,
having pressed F11 here, resulted into effect of pressing F10
So Visual Studio notifies us..and gives this beautiful, well illustrated message, which I could only understand when I read the following blogpost
Credits: AutoStepOver a blog post
The other answers are suffient for turning the feature on or off. Lacking is the insight as to WHY one would want to do one or the other.
For beginning C# programmers their property method is a simple {get,set}. Since this code is not worth viewing we check the box "Step over properties...".
However, when your property settings become more interesting, you may want to step into the property method to ensure it's behavior is correct. Once you tell the IDE "Don't bother me any more", then later when your "step into" fails for a complex property method, now it's your fault.
My recommendation would be either to remember how to switch the option on and off for future debugging sessions or uncheck the "Step over..." setting and learn to toggle between F11 and F10 as appropriate.
Another option is never to use "step into". Just set a breakpoint in the method/property/operator you want to debug and click the step (F10). This way you step into only the methods you are debugging.
I am curious to know if there is a way to edit code in C# VS 2008 right when it has hit a breakpoint and I am walking thru the code... can I modify the code (such as the value in a variable or if my stepthrough line is about to hit an if statement ... can I modify the if statement....etc)?
So far, I have to stop running VS, modify the code, then hit F5 and wait till the breakpoint is hit again.
When the breakpoint hits, and I am walking thru the code, and I attempt to edit the code, I get a message "Changes are not allowed when the debugger has been attached to an already running process of the code being debugged was optimized at build or run time."
There are only a few reasons I know of why Edit+Continue would be disabled in the Debug build. First and foremost is a 64-bit operating system, E+C only works for 32-bit code. Fix that with Project + Properties, Build tab, Platform Target = x86.
It is also an option that might have been turned off. Tools + Options, Debugging, Edit and Continue, Enable checkbox.
If this doesn't help, tell us a bit more about the kind of code you're debugging, the project template you selected when you started the project, how you got the debugger to break and a stack trace copied from the Call Stack window.
Yes, you can.
This is called Edit and Continue.
Note that it has some limitations.
EDIT: You need to switch to a debug build.
To modify the value of a variable or set a property while in break mode go to the Immediate window, set the new value, and hit return e.g.
strValue = "newValue"
Calendar1.Enabled = true
To retrieve a value you can just print it to the window e.e.
?strValue
?Calendar1.Enabled
Stop running your app.
Go to Tools > Options > Debugging > Edit and Continue
Disable “Enable Edit and Continue”.
In response to this question:
can I modify the code (such as the
value in a variable or if my
stepthrough line is about to hit an if
statement ... can I modify the if
statement....etc)?
You cannot pop a new value into a variable directly, but what you can do is this:
Set a breakpoint
When that breakpoint is hit, click on the arrow in the left margin and drag it up to a previous line
Now you can add code to change the circumstances (for example, you can set a variable to a new value, add/remove items from a collection, etc.)
See the other answers about enabling Edit & Continue -- in particular, make sure you're in Debug mode.
To solve this problem I did the following...
BUILD > CONFIGURATION MANAGER
Active solution configuration: DEBUG
project context configuration: DEBUG
then TOOLS > OPTIONS > DEBUGGING > EDIT & CONTINUE
make sure edit & continue is selected
then BUILD > CLEAN SOLUTION
then BUILD > REBUILD SOLUTION
Then start debug, then pause, then your code should be editable
Below answer worked for me :
http://whyiamright.wordpress.com/2007/12/20/aspnet-edit-and-continue-in-visual-studio-2005/
The second point says - project-properties-web-> enable edit and continue.
thats it.