I would like to log the DataBinding errors to a file. I Used the solution presented in this accepted anwser:
How can I turn binding errors into runtime exceptions?
I used a technique similar to the one described in the first link you provided. It can be resumed by the following steps:
TraceListener
that throws instead of loggingPresentationTraceSources.DataBindingSource
I tested with .NET Framework 4.0, 4.5 and 4.5.1; it works on both Debug
and Release
configurations.
Please check the complete solution I pushed on GitHub, it includes a demo application and a unit test project.