Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
240
Exception parsing RibbonWindow (XP in Olive Green)
posted

Hey guys, I've just encountered this exception when our WPF desktop application is attempting to load on a couple of Windows XP systems. I've never seen this before (even on other XP systems) and it seems to be coming from within the NetAdvantage libraries. Although it's highly possible it's due to my use of those libraries.

I can't think of any reason these two systems would have this problem. My application and the assemblies I'm using are all targeting .Net CLR 4.0 which these machines do have.

Any insight would be greatly appreciated!

 

Here's the exception:

System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'Infragistics.Windows.Ribbon.RibbonWindowContentHost' that matches the specified binding constraints threw an exception. ---> System.Xaml.XamlObjectWriterException: Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'RibbonBrushKeys.ScenicCaptionCloseBtnPressedBorderFillKey' Key being added: 'RibbonBrushKeys.ScenicCaptionCloseBtnPressedBorderFillKey'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.Add(Object key, Object value)
at System.Windows.ResourceDictionary.SetKeys(IList`1 keyCollection, IServiceProvider serviceProvider)
at System.Windows.ResourceDictionary.SetDeferrableContent(DeferrableContent deferrableContent)
at System.Windows.Baml2006.WpfSharedBamlSchemaContext.<Create_BamlProperty_ResourceDictionary_DeferrableContent>b__168(Object target, Object value)
at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
--- End of inner exception stack trace ---
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(Object obj, XamlMember property, Object value)
at System.Xaml.XamlObjectWriter.SetValue(Object inst, XamlMember property, Object value)
at System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteEndMember()
at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter)
at System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(Assembly assembly, String assemblyName, String resourceName, Boolean isTraceEnabled)
at System.Windows.SystemResources.ResourceDictionaries.LoadThemedDictionary(Boolean isTraceEnabled)
at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
at System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)
at System.Windows.FrameworkElement.FindResourceInternal(FrameworkElement fe, FrameworkContentElement fce, DependencyProperty dp, Object resourceKey, Object unlinkedParent, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, DependencyObject boundaryElement, Boolean isImplicitStyleLookup, Object& source)
at System.Windows.ResourceReferenceExpression.GetRawValue(DependencyObject d, Object& source, DependencyProperty dp)
at System.Windows.ResourceReferenceExpression.GetValue(DependencyObject d, DependencyProperty dp)
at System.Windows.DependencyObject.EvaluateBLOCKED EXPRESSION

Parents
  • 240
    posted

    Alright, we have found the culprit!

    These two particular XP systems just happened to be using the Olive Green theme for Windows and that is what causes our exception.

    We've now been able to reproduce it on any other Windows XP machine simply by changing the theme to Olive Green.

    So, our client is happy now. But this leads me to ask: Why would this matter?

    Do you guys attempt to automatically load a certain theme based on what Windows is using? Our application uses the Office2k7 Blue theme for all Infragistics controls and we don't distribute any of your special theme libraries with our product.

    Any idea on how we might be able to get our app to work in Windows XP with an Olive Green theme?

Reply Children