.netvisual-studiodebuggingstep-into

Visual Studio 2008 - how to step into (F11) reflected code


What needs to be done to be able to step-into (F11) the reflected code.

I am creating the object using reflection:

myObject.GetType().GetConstructor().Invoke(myParams)

and I want to go into the constructor's code. If I press F11 it just skips the constructor's code ;(

but at the same time if I put a breakpoint at ctor and hit F5 - it will hit this breakpoint.

So, is there anything I can do to enable stepping into reflected code.


Solution

  • Just My Code might be what is causing problems.

    In Visual Studio:

    1. Tools --> Options
    2. Debugging (on the left)
    3. Untick "Enable Just My Code (Managed Only)" on the right.

    I can't guarantee that is what is causing the problem - but it is my best bet.