【发布时间】:2015-05-22 07:40:00
【问题描述】:
我正在调试一个应用程序,并且在某个时刻,我有一个包含大量项目的列表,这让我无法一步一步地观察每个元素。我想检查 PropertyName = "XXX" 的元素的属性 Layer 内的值。有什么简单的方法吗?
外层代码:
var metadata = FieldsConfigurationProvider.GetAllFieldsConfiguration();
RequestDocumentTypeModel model = new RequestDocumentTypeModel()
{
Requester = CurrentUser.Login,
MetadataItems = metadata.Where(f => !f.IsSystemGenerated).Select(f => new RequestDocumentMetadataItem(f.DocumentModelPropertyName, f.DisplayName, false, f.Layer)).ToList()
};
// BREAKPOINT HERE
// # MORE CODE #
当然我不能使用即时窗口和 LINQ,因为不允许使用 LINQ。我使用的是 Visual Studio 2010,但据我所知,其他版本也有同样的“问题”。
【问题讨论】:
-
你能不能写一个函数,从输入
PropertyName返回你想要的,然后在调试的时候在quickwatch中运行? -
您在寻找什么?蒂姆关于使用条件中断的建议可能是正确的 (+1),但我怀疑当你得到一个无论出于何种原因的错误值时,你应该使用它来中断
-
@leppie - 谢谢 :) 这很有帮助。
标签: c# visual-studio