By Joe Ye
When I try to launch Revit from VS2010 for debugging I get a list of errors in the VS immediate window. There are three kinds of error:
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Autodesk.Private.Windows.ToolBars.ToolBarControl', AncestorLevel='1''. BindingExpression:(no path); DataItem=null; target element is 'RibbonMinimizeExecuteButton' (Name='mMinimizeButtonExecute'); target property is 'NoTarget' (type 'Object')
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Stop'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='28008429'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='Autodesk.Private.Windows.RibbonPanelControl'; TargetElement.HashCode='42815556'; TargetElement.Type='Autodesk.Private.Windows.RibbonPanelControl'
I have tested the SDK sample and get the same results. However this doesn’t matter the loading of the plug-ins and execute of the commands.
For the reason of this wrong was talked about in an existing post in AutoCAD DevBlog.
Suppressing DataBinding ‘error’ messages in the Visual Studio output window
Here is the way to suppress the Databinding ‘error’ messages in the Visual Studio output window.
Open Revit.exe.config file which is in the same folder as Revit.exe file. And append the following content to it.
<system.diagnostics>
<sources>
<source name="System.Windows.Data"
switchName="SourceSwitch">
<listeners>
<remove name="Default" />
</listeners>
</source>
<source name="System.Windows.Media.Animation"
switchName="SourceSwitch">
<listeners>
<remove name="Default" />
</listeners>
</source>
</sources>
</system.diagnostics>
The first Source node is to suppress Error 4 and 5. The second Source node is to suppress Error 6.