在我的代码中:
List<int> x = new List<int>();
IEnumerable<object> y = x as IEnumerable<object>;
并且y为null,但在Visual Studio的监视窗口和即时窗口中它强制转换(2015 Professional和2017 Community)。是什么赋予了?
最佳答案
这听起来像是表达式评估器中可能存在的错误-如果在“调试选项”中选中“使用旧式表达式评估器”,则“监视”窗口的行为正确。
关于c# - 观看窗口与代码,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44043519/