0

My Output is filled with rows of errors/warning that from what I can tell from my research everyone just ignores. (Sample pasted bellow). I've done a little digging and I think the culprit is AutomationProperties. I've learned a lot for the next time I need to develop an accessible application but for this one I don't need LabeledBy,HelpText,...

Assuming I'm right with my analysis that AutomationProperties is causing these outputs. How do I go about silencing/muting/[Render unable to output to console].

I'm trying to clean up my output so that when my application writes to console I'm not required to dig through 95% of identical rows that will "always" be ignored.

As a general question - How do you silence things polluting the output (useful information not needed for current project).

System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=(0); DataItem=null; target element is 'TextBox' (Name='PART_EditableTextBox'); target property is 'Name' (type 'String')
System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=(0); DataItem=null; target element is 'TextBox' (Name='PART_EditableTextBox'); target property is 'LabeledBy' (type 'UIElement')
System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=(0); DataItem=null; target element is 'TextBox' (Name='PART_EditableTextBox'); target property is 'HelpText' (type 'String')
System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=IsEditable; DataItem=null; target element is 'ToggleButton' (Name='toggleButton'); target property is 'NoTarget' (type 'Object')
System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=(0); DataItem=null; target element is 'TextBox' (Name='PART_EditableTextBox'); target property is 'Name' (type 'String')
System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=(0); DataItem=null; target element is 'TextBox' (Name='PART_EditableTextBox'); target property is 'LabeledBy' (type 'UIElement')
System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=(0); DataItem=null; target element is 'TextBox' (Name='PART_EditableTextBox'); target property is 'HelpText' (type 'String')
System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=IsEditable; DataItem=null; target element is 'ToggleButton' (Name='toggleButton'); target property is 'NoTarget' (type 'Object')
Mandelbrotter
  • 2,216
  • 2
  • 11
  • 28
  • How to you start the console? An app or a start process from an app? –  Oct 01 '19 at 21:38
  • This is when I'm running my app in debug mode in Visual Studio ([Right Green arrow] Start) button – Mandelbrotter Oct 01 '19 at 21:41
  • `Console.SetOut(TextWriter.Null);` and/or `Console.SetError(TextWriter.Null);` –  Oct 01 '19 at 21:47
  • I'm not looking to disable all. (That would affect the ones I want to read) I just want to disable the ones from sources I have found to be "ignorable" such as the ones from AutomationProperties – Mandelbrotter Oct 01 '19 at 21:49
  • I don't know... –  Oct 01 '19 at 21:51
  • Found that: [Lots of unexpected “Cannot retrieve value using the binding” errors](https://stackoverflow.com/questions/51836141/lots-of-unexpected-cannot-retrieve-value-using-the-binding-errors) –  Oct 01 '19 at 22:00
  • @Olivier Merci beaucoup. In the link you provided I found a another link to https://weblogs.asp.net/akjoshi/resolving-un-harmful-binding-errors-in-wpf I can't wait to try both their work arounds. If it works I'll ask you to make your comment an answer. – Mandelbrotter Oct 02 '19 at 12:58

1 Answers1

0

Oddly following the steps to Display WPF Trace Information solved my issue.

I don't know why the instructions say to turn off the settings you want but it solved my issue:

Under WPF Trace Settings, click the category of settings that you want to enable (for example, Data Binding).

A drop-down list control appears in the Settings column next to Data Binding or whatever category you clicked.

Click the drop-down list and select Off.

It didn't solve the problem of trying to display the Tree but it did solve the issue I had in the post: My output being littered with "harmless" lines of text.

If you want to hide the problem I'd recommend this step. If you want to resolve the issue I would recommend the link provided by @"Olivier Rogier" Lots of unexpected “Cannot retrieve value using the binding” errors or the link found in the answer of that link Resolving harmless binding errors in WPF. I hope this answer helps someone. Thank you @Olivier for you help.

Mandelbrotter
  • 2,216
  • 2
  • 11
  • 28