相关疑难解决方法(0)

调试时,当前上下文中不存在变量

我插入了两个临时变量并希望看到它们的值,但我不能.我可以把它放在其他地方来解决它,但我很感兴为什么这种行为存在.

   public float Value
    {
        get
        {
            float result = Memory.ReadFloat(Address);

            double Radian = Math.Round(result, 2); // **BREAK POINT HERE**
            double Degree = Math.Round(Math.Round((double)(result * 180 / Math.PI)), 2); // **BREAK POINT HERE**

            return result; // **BREAK POINT HERE**
        }
    }
Run Code Online (Sandbox Code Playgroud)

我打破了所有这三点,但我无法让Visual Studio 2012向我展示价值观.只有结果会显示在locals窗口中,没有名为Radian或Degree的变量.

例如,如果我为Radian变量添加一个监视器,我会收到带有红色十字图标的消息:

Radian - 当前上下文中不存在名称'Radian'

.net c# debugging properties visual-studio-2012

25
推荐指数
3
解决办法
2万
查看次数

标签 统计

.net ×1

c# ×1

debugging ×1

properties ×1

visual-studio-2012 ×1