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

后端 未结 15 1487
北荒
北荒 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:48

    You are probably trying to debug your app in release mode instead of debug mode, or you have optimizations turned on in your compile settings.

    When the code is compiled with optimizations, certain variables are thrown away once they are no longer used in the function, which is why you are getting that message. In debug mode with optimizations disabled, you shouldn't get that error.

提交回复
热议问题