C4u C4u - 10 months ago 43
C# Question

VS Breakpoint overjump

There is a strange problem I'm stuck with about breaking into code. The structure where this happens for me looks as following:

public partial class TopClass : SomeBaseClass
protected override void ShowDetail(ResultItem resultitem)
// Trying to break here without success
string test = "should be able to break here, shouldnt it?";

public partial class SomeBaseClass : ...
protected virtual void ExecutionIncomingHere()
// .. some stuff going on

protected virtual void ShowDetail(ResultItem resultitem)
{ // empty

The problem I've got is easier to just show off. Check this:

Breakpoint is set.

VS only breaks inside my base (why ever)

I guess this arrow indicates, that I'm currently inside that method. By why cant I debug inside
? When going for
it continues inside the base class. So my
is never entered step-by-step.

I tried searching on google for at least 1 hour without any success. I hope some of you can clear that out.

Appreciate your help, thanks!

Answer Source

It sounds like you have "Optimize code" checked. To remove this go to the properties of you project, then click on the "Build" tab on the left hand side. There you should see the "Optimize code" check box. If this is checked, uncheck it. That should fix your issue.