c# - Debugging issue (VS2010) when using dynamic keyword -


while debugging compiler (mostly) written in c#, noticed following issue, tried map simplified code fragment:

public class program {     public abstract class base     {         public abstract void foo();     }      public class : base     {         public override void foo()         {             console.writeline("a");         }     }      public class b : base     {         public override void foo()         {             console.writeline("b");         }     }      public static void printout(base obj)     {         printoutimpl((dynamic)obj);     }      public static void printoutimpl(a aobj)     {         aobj.foo();     }      public static void printoutimpl(b bobj)     {         bobj.foo();     }      public static int main(string[] args)     {         b bobj = new b();          printout(bobj);          return 0;     } } 

basically, there 2 implementations of printout(..). dynamic keyword used determine corresponding implementation @ runtime. when i'm debugging , try step through code, debugger not enter corresponding printoutimpl(..) method unless there breakpoint set in method body.

so question whether there option disable/modify such behaviour. it's realy annoying set (and remove) breakpoints enforce debugger enter method body.

thanks! dinony

use "step into"(f11) instead of "step over"(f10). tested code, , correctly steps printoutimpl(b bobj) , console.writeline("b");


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -