Hello,
We are experiencing an exception during the constructor of a form.
Error: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at Infragistics.Win.AppStyling.StyleUtilities.StyleHashtable`2.Add(TKey key, TValue value) at Infragistics.Win.AppStyling.StyleUtilities.UpdateRoleHierarchy(StyleHashtable`2 table, AssemblyStyleInfo[] assemblyInfos) at Infragistics.Win.AppStyling.StyleManager.ProcessLoadedAssembliesImpl() at Infragistics.Win.AppStyling.StyleManager.ProcessLoadedAssemblies() at Infragistics.Win.AppStyling.StyleManager.GetComponentProperties(String componentRoleName) at Infragistics.Win.AppStyling.StyleManager.ComponentStyleCache.GetProperties() at Infragistics.Win.AppStyling.StyleManager.PropertyInfoCache.ParseProperty(String propertyName) at Infragistics.Win.AppStyling.StyleManager.PropertyInfoCache.GetProperty(String propertyName) at Infragistics.Win.AppStyling.StyleManager.GetComponentPropertyValue(String componentRoleName, String propertyName) at Infragistics.Win.AppStyling.ComponentRole.GetProperty(String propertyName) at Infragistics.Win.UltraWinTabControl.StyleUtils.GetCustomPropertyValue(UltraControlBase ultraCtrl, CachedProperty prop, Object resolveVal) at Infragistics.Win.UltraWinTabControl.UltraTabControlBase.get_ViewStyleResolved() at Infragistics.Win.UltraWinTabControl.UltraTabControlBase.ResolveDefaultTabAppearance(UltraTab tab, TabState state, AppearanceData& appearance, AppearancePropFlags& requestedProps, Boolean resolvingPageArea) at Infragistics.Win.UltraWinTabControl.UltraTabControlBase.ResolveDefaultTabAppearance(UltraTab tab, AppearanceData& appearance, AppearancePropFlags& requestedProps, Boolean resolvingPageArea) at Infragistics.Win.UltraWinTabControl.UltraTabControlBase.ResolveDefaultTabAppearance(UltraTab tab, AppearanceData& appearance, AppearancePropFlags& requestedProps) at Infragistics.Win.UltraWinTabControl.UltraTabControlBase.ResolveClientAreaAppearance(AppearanceData& appearance, AppearancePropFlags& requestedProps) at Infragistics.Win.UltraWinTabControl.UltraTabPageControl.get_BackColor() at System.Windows.Forms.Control.get_RenderTransparent() at System.Windows.Forms.Control.OnMove(EventArgs e) at System.Windows.Forms.Control.OnLocationChanged(EventArgs e) at Infragistics.Win.UltraWinTabControl.UltraTabPageControl.OnLocationChanged(EventArgs e) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height) at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) at System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) at System.Windows.Forms.Control.set_Location(Point value) at MyView.InitializeComponent() in D:\DOTNET\Local\MyView.Designer.vb:line 102 at MyView..ctor()
During application startup, a seperate thread is started where all views are preloaded. At the same time the constructor of the main form is called.
We suspect this is a threading issue and that the AppStyling is not completely thread safe.
Kind regards,
Michael
Hello ,
As far as I know Infragistics Component are not thread-safe, in fact DotNet controls are not thread-safe.
http://forums.infragistics.com/forums/p/28153/109410.aspx#109410
http://forums.infragistics.com/forums/p/49475/261653.aspx#261653
So my suggestion is to load your isl. file after you complete preloading of your views.
Please let me know if you have any further questions.
I do not agree, the DotNet controls are thread safe as long as you don't use the same control from within different threads. But if you have different threads each referencing a seperate controls, there won't be any problem.
The problem here is that the infragistics components are not thread safe even if seperate threads use seperate controls.
I'm not sure what you mean by "isl file", I don't know what that is, nor do I use that.
I just have seperate threads calling a constructors on seperate form's initializecomponent, and occasionally the exception mentionned is displayed.