Variable does not exist in the current context while debugging

前端 未结 5 1157
春和景丽
春和景丽 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:49

    I had a .NET Standard project, and what worked for me was to go:

    • Project properties.
    • Build tab.
    • Advanced button (all the way at the bottom-right).
    • Change the "Debugging information" option to full.

    It had been set to "Portable". Changing it to "Full" allowed me to see variables in Watch and Immediate windows again.

    Not sure if it it's relevant, but I had recently converted the project from PCL to .NET Standard. Maybe something got lost in translation.

提交回复
热议问题