Variable does not exist in the current context while debugging

前端 未结 5 1158
春和景丽
春和景丽 2020-12-29 21:58

I inserted two temp variables and want to see their values, but I can\'t. I could solve it by placing it somewhere else, but I\'m interested why this behaviour exists.

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-29 22:52

    I changed my Solution Configuration to Debug (Any CPU) but that wasn’t the problem. After upgrading to Visual Studio 2017 I thought I was in Debug but there was one more simple (but important) step. (And it’s probably obvious to most, but I missed it.) Where “Solutions Configurations” is set to “Debug” I had to ALSO click the down arrow next to “Debug” and select “Configuration Manager…” and then in that corresponding popup window “Configuration” was still set to “Release” – I had to change that to “Debug” and click the “Close” button. Rerunning from there allowed me to view all variables while debugging.

提交回复
热议问题