VS2010 Adding a breakpoint in RazorGeneratorMvcStart - asp.net-mvc-3

When I attempt to debug my MVC 3 app a breakpoint is automatically added in the static class RazorGeneratorMvcStart
at in the static Start() method at the line:
ViewEngines.Engines.Insert(0, engine);
When I delete the breakpoint during the run it still comes back and most pages hit this method several times with each call.
Is there a way I can prevent this breakpoint from being added or what is causing the breakpoint to be added here. I have checked the files and it does not show the break point there anywhere I can find. But it gets added to the class every time I hit a view. When not debugging the file does not show the symbol. I tried adding and then removing a breakpoint there as well but that has no effect, a breakpoint is added there the next time a view hit.
If I disable the breakpoint and leave the file open in VS it seems to bypass through out that action. But the next action call the breakpoint returns.

Try Debug -> Delete All Breakpoints (Ctrl + Shift + F9).

Try to delete the breakpoint when the application is NOT running

Related

failed to set breakpoint site at 0x9dd200 for breakpoint 197.1: error sending the breakpoint request

I can not make a breakpoint in my xcode.
It print "warning: failed to set breakpoint site at 0x85d5f0 for breakpoint 279.2: error sending the breakpoint request
" all the time
You've most likely deleted the file or the file / folder structure changed such that the breakpoint is now invalid. Switch to the Breakpoint Navigator in Xcode and find (and delete) all the files marked in red. You can even enter "279.2" in the search field below the panel to find out the faulty breakpoint.
If you're unable to create breakpoints still, make sure the file you're adding break point to has been added to the target you're debugging.
In my case I forgot to set initial view controller in storyboard.

In Visual Studio is there an easier way to open source code through a PDB then to step into a function call from that library?

I want to be able to browse the source and set a debug point without having to hunt for a way to get the file open. I know you can open the original source and detach/reattach the debugger but that is a pain to do every time you run.
If you remember the name of the method you want to debug by heart, you can Add New Breakpoint (Ctrl+B) and type "MyClassName.MyMethodName" (enter). That will put a breakpoint in the beginning of that method, and when you run, as soon as it's hit, the file will open.

Prevent VS to jump to call return when breaking debug

When you break the debug in Visual Studio (through the Break All menu or the shortcut CTRL+ALT+BREAK by default), it jumps to the line of the call return.
(In my case, using winforms, it jumps to the Application.Run(); line of the Program.cs file).
It's kind of annoying when you're debugging a method and every time you hit Break All, the focus is set back on a file you weren't working on.
Is it possible to disable that jump? I couldn't find any option in the Debugging part of the VS options.
It's not "jumping" - it's breaking to the currently executing line of code. This is the behavior, and is not configurable.
If you want to have it stop at a specific line of code where you're working, you can just set a break point there, instead. This will cause it to break at your breakpoint as soon as it executes the code there.

Visual Studio 2010: Multiple requests debugging at the same time (Annoying!)

The setup
I have an MVC application that's making AJAX requests into my controller. The javascript is making more than one such request.
On my controller that gets called, I have a break point.
The annoyance
When I want to debug that controller action method, I hit my breakpoint, press F10 to continue on, but then the second request comes in and I hit the breakpoint again! I've now got two requests flowing through my code, and pressing F10 steps between the two, making the debugging nearly impossible as the current line jumps up and down, between files, etc without any consistent flow as it's tracking more than one request in the current debugging session!
My question
Can I tell a single request to just... go away... without affecting the other one? I've tried F5ing just one request, but that makes both continue, not just the current one.
You could disable the breakpoint immediately after its first hit (Ctrl-F9, or right click on the breakpoint and click disable - this is different from removing the breakpoint).
You can also "Freeze" a thread in the threads window (right click on the thread and click "Freeze" - use "Thaw" to reverse this).

Setting Xcode breakpoint by code? (like pause() function)

I'm finding a way pausing program execution by code on Xcode
As an example, I can stop execution with abort() C function. This pops Xcode debugger up.
However, this exits program completely, so I'm finding a way to pause execution. So I can resume execution after checking execution states.
This is required for handling light-weight errors. I tried pause() C function, but it doesn't work. The execution aborted instead of pausing.
If you want to be able to break on a specific function whenever there's an error, then define a function like so:
void BREAK_HERE_Eonil(void) {
NSLog(#"Set a breakpoint on BREAK_HERE_Eonil to debug.\n");
}
Call BREAK_HERE_Eonil() whenever you would like to enter the debugger. Set a breakpoint on BREAK_HERE_Eonil() in Xcode. Now, run under the debugger. Whenever you hit this function, you'll break into the debugger.
You might also be able to use the old Debugger() call; Xcode has an option under the Run menu to "Stop on Debugger()/DebugStr()".
You can also just run your app under the debugger and hit the big pause button in the debugger window whenever you want to break in.
Another method I often use in iOS programming is to include a breakpoint in an if statement. Like so:
if (your_condition) {
//put an Xcode breakpoint here
}
That way I can conditionally call breakpoints in loops and other places that get called too often to have an unconditional breakpoint.

Resources