2009-06-15 55 views
0

我有一个属性被另一个类设置的类。在这个属性制定者的内部,程序爆炸了。使用INotifyPropertyChanged调试Visual Studio 2008中的属性设置

我只需要知道什么类实际设置属性。

我以为我可以看看栈跟踪,但因为我使用INotifyPropertyChanged我认为它不会给我所需的全部信息。

这里是堆栈跟踪如果这有助于!

MyProject!MyProject.MyClass.MyProperty.set(string value = "") Line 24 C# 
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.dll!System.Windows.CLRPropertyListener.Value.set(object value = "") + 0x58 bytes 
System.Windows.dll!System.Windows.PropertyAccessPathStep.Value.set(object value = "") + 0x28 bytes 
System.Windows.dll!System.Windows.PropertyPathListener.LeafValue.set(object value = "") + 0x28 bytes  
System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValue() + 0x26c bytes  

System.Windows.dll中System.Windows.Data.BindingExpression.TargetTextBoxLostFocus(对象发件人= {} System.Windows.Controls.TextBox ,System.Windows.RoutedEventArgs e = {System.Windows.RoutedEventArgs})+ 0x55 bytes
System.Windows.dll!System.Windows.CoreInvokeHandler.InvokeEventHandler(int typeIndex = 160,System.Delegate handlerDelegate = {System.Windows。 RoutedEventHandler},object sender = {System.Windows.Controls.TextBox},object args = {System.Windows.RoutedEventArgs})+ 0x6b3 bytes System.Windows.dll中!MS.Internal.JoltHelper.FireEvent(System.IntPtr unmanagedObj = 173934552,System.IntPtr unmanagedObjArgs = 273432032,INT argsTypeIndex = 160,串eventName的= “M @ 2910”)+ 0x335字节

回答

1

嗯。 。 。

你可以在你的属性setter中断点并使用Call Stack窗口来追踪哪一个叫它。

+0

它不适用于INotifyPropertyChanged – zachary 2009-06-15 18:02:29

1

这是一个有点老派,但你有没有尝试过添加Debug.WriteLine()语句来跟踪你的程序执行?您可以在程序运行时在VS Output窗口中查看Debug.WriteLine()的结果。

相关问题