Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible

前端 未结 11 1618
执笔经年
执笔经年 2020-12-15 16:54

Here is the error

Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code

11条回答
  •  伪装坚强ぢ
    2020-12-15 17:20

    For what it's worth, this error can also be caused by an infinite loop in a property getter (simplified version below). When the debugger attempts to evaluate the property (e.g. in the watch window) the UI will hang for a few seconds and the "Cannot evaluate expression..." error will appear for many of the other properties in the same class.

    public int MyProperty
    {
        get
        {
            while (true) { }
            return 0;
        }
    }
    

提交回复
热议问题