I need help with an annoying bug that I can't seem to overcome.
In my work I have a large WPF/C# program and sometimes when you login there is an exception thrown, a null reference exception at System.Windows.Data.BindingExpression.IsValidValueForUpdate.
The exception is only caught in the app.xaml.cs as a DispatcherUnhandledExceptionEventArgs
and when I look at the data of the exception it contains a key that is an object (not specific object) and the value of the key is null.
How do I even start and find the problem? I read online multiple things and I put some code in comment but still can't find what is wrong. If anyone has advice how to debug this kind of problem it would be much appreciated. Thanks in advance
For anyone who comes across this problem, I fixed in my project. In one of the xamls there was a binding with a OnwWayToSource mode and a converter. The link below has an answer by a user that figured this out. (WPF) Binding OneWayToSource with a converter results in immediate exception
Apparently a binding with a OnwWayToSource and converter throws this exception and the work around is to give a data context. The solution I did was that I saw that the code can have a TwoWay mode in the Convert function of the converter just write "return value;"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With