What does “Cannot evaluate expression because the code of the current method is optimized.” mean?

后端 未结 15 1449
北荒
北荒 2020-12-08 09:24

I wrote some code with a lot of recursion, that takes quite a bit of time to complete. Whenever I \"pause\" the run to look at what\'s going on I get:

<
15条回答
  •  执念已碎
    2020-12-08 09:49

    The Debugger uses FuncEval to allow you to "look at" variables. FuncEval requires threads to be stopped in managed code at a GarbageCollector safe point. Manually "pausing" the run in the IDE causes all threads to stop as soon as possible. Your highly recursive code will tend to stop at an unsafe point. Hence, the debugger is unable to evaluate expressions.

    Pressing F10 will move to the next Funceval Safe point and will enable function evaluation.

    For further information review the rules of FuncEval.

提交回复
热议问题