While editing a WPF custom control the design view in Visual Studio 2019 ran into this error:
(entire exception details down below).
Web searches have turned up nothing useful for RuntimeVisibility
, although there are other similarly worded "is not a valid value" messages they seem quite varied. I can't even find the term "RuntimeVisibility" almost at all related to WPF.
So I tried to debug the VS2019 designer process by attaching to XDesProc in a separate VS2019 instance. By enabling trapping of all exceptions it would indeed break when the control in question was loaded into the designer. But it isn't failing in any user-level code; the problem emerges from somewhere deep inside the framework and the debugging information at that stack frame is meaningless to me.
I'm looking for a methodology or advice to track down the root cause of this problem. While it's annoying in the designer I'm more concerned if this could lead to an error at runtime. As noted, the mysterious RuntimeVisibility
property doesn't seem like a designer-specific issue.
Full exception info:
XamlParseException: '' is not a valid value for property 'RuntimeVisibility'.
StackTrace
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)
at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
at System.Windows.FrameworkElement.ApplyTemplate()
InnerException: '' is not a valid value for property 'RuntimeVisibility'.
ArgumentException: '' is not a valid value for property 'RuntimeVisibility'.
StackTrace
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
InnerException: None