SAP Knowledge Base Article - Public

2158245 - When viewing in Debug mode the Output windows shows Key Binding errors in a WPF .net app

Symptom

When compiling a WPF .NET app in CR for VS and running the application the Output window always shows some binding errors.

Environment

Crystal Reports for Visual Studio

Reproducing the Issue

In the Output Windows you will see something like this:

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<(><<)>null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnOpen'); target element is 'Button' (Name='btnOpen'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<(><<)>null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnPrint'); target element is 'Button' (Name='btnPrint'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<(><<)>null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnRefresh'); target element is 'Button' (Name='btnRefresh'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<(><<)>null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnExport'); target element is 'Button' (Name='btnExport'); target property is 'Name' (type 'String')

.......

Resolution

Response from our Developers:

The above error messages are disconcerting because they look like there’s something horribly wrong with your project. 
These messages don’t mean you have a problem. They are a result of how Microsoft handles WPF behind the scenes.
You can safely ignore them.

If you want to remove them, you can edit your App.config file (located in your project folder) and add the following lines below to the configuration section:

<configuration>
  <system.diagnostics>
    <sources>
      <source name="System.Windows.Data" switchName="SourceSwitch">
        <listeners>
          <remove name="Default" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>

As a result of the above finding no patch will be provided.

Keywords

Crystal Reports for visual studio, WPF, Binding error, System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio