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
2732
Exception with AppStyling & Form Constructor
posted

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

Parents Reply Children