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
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?
I've submitted this to support.
Case #:
CAS-52754-0M613B
HI, I duplicated your issue and have submitted if for developer review.
I will communicate with you via CAS-52754-0M613B
Sincerely. Matt Developer Support Engineer
Any solution ?
HI,
The issue is being reviewed by our developers. I don't have a time frame for implementation.
Sincerely, Matt Developer Support Engineer
We also encountered the same issue with version 10.2 and were able to reproduce it with the XamRibbonWindow demo that came with the FeatureBrowser
(XamRibbon -> Composition walk through -> xamRibbon Window -> [click on Launch Window image].
When the XP color style is Silver or Blue, the demo would run fine. Switch back to Olive Green would cause the demo to crash with the exception
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)
Anyone knows if this issue is resolved? Our clients really like to use Olive Green XP color scheme.
Hi netlabhr,
The issue should be fixed in the last services releases.
Sincerely,
Horen Kirazyan