Bug Report T511396
Visible to All Users

Web Dashboards - ArgumentException - An item with the same key has already been added

created 8 years ago (modified 8 years ago)

This error can occur if the application model contains different BO Models with the same Caption and is visible in dashboards.

Type:       ArgumentException
    Message:    An item with the same key has already been added.
    Data:       0 entries
    Stack trace:

at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at DevExpress.ExpressApp.Dashboards.Web.DataSourceStorage…ctor()
   at DevExpress.ExpressApp.Dashboards.Web.DashboardsAspNetModule.get_DataSourceStorage()
   at DevExpress.ExpressApp.Dashboards.Web.DashboardsAspNetModule.Application_DetailViewCreated(Object sender, DetailViewCreatedEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at DevExpress.ExpressApp.XafApplication.OnDetailViewCreated(DetailView view)
   at DevExpress.ExpressApp.XafApplication.CreateDetailView(IObjectSpace objectSpace, String detailViewID, Boolean isRoot, Object obj)
   at DevExpress.ExpressApp.XafApplication.CreateDetailView(IObjectSpace objectSpace, Object obj, View sourceView)
   at DevExpress.ExpressApp.Dashboards.Web.WebEditDashboardController.ShowDesignerAction_CustomizePopupWindowParams(Object sender, CustomizePopupWindowParamsEventArgs e)
   at DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventHandler.Invoke(Object sender, CustomizePopupWindowParamsEventArgs e)
   at DevExpress.ExpressApp.Actions.PopupWindowShowAction.GetPopupWindowParams()
   at DevExpress.ExpressApp.Web.PopupWindowManager.GetPopupWindow(PopupWindowShowAction action)
   at DevExpress.ExpressApp.Web.Templates.ActionContainers.Menu.PopupWindowActionMenuActionItem.ExecuteAction(ASPxMenuBase menu)
   at DevExpress.ExpressApp.Web.Templates.ActionContainers.ActionContainerHolder.ExecuteMenuItem(IList`1 items, String itemName)
   at DevExpress.ExpressApp.Web.Templates.XafCallbackManager.ProcessAction(String parameter)
   at DevExpress.ExpressApp.Web.Templates.XafCallbackManager.callbackControl_Callback(Object source, CallbackEventArgs e)
   at DevExpress.Web.ASPxCallback.OnCallback(CallbackEventArgs e)
   at DevExpress.Web.ASPxCallback.RaiseCallbackEvent(String eventArgument)
   at DevExpress.Web.ASPxWebControl.System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
    InnerException is null

Attached is a sample project demonstrating the issue.

A temporary workaround is either to make captions different or remove the VisibleInDashboardsAttribute from classes that are not required in dashboards.

Answers approved by DevExpress Support

created 8 years ago

We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

    Show previous comments (9)
    DevExpress Support Team 8 years ago

      Why not, like Android version code names. :-)

        this version numbers are not familiar to me. What did you mean with "but it will be included into the next maintenance update for version 17.1."  I want to learn when do you think this update will be available approximately? and what its version number will be 17.1.1.x or 17.1.2.x or 17.2?

        Dennis Garavsky (DevExpress) 8 years ago

          @Çağlar Özkul: The fix will be available in v16.2.7 and v17.1.4, which are expected in a couple of weeks or so.
          Right away, you can download the hotfix for v16.2 from here: DevExpressComponents-16.2.6.17125.exe

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.