This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.
When deploying a package on your 4.7 environment through P&D, one of the Views fails to deploy with the error below returned:
"An item with the same key has already been added"
"Fail <View Name> An item with the same key has already been added. System.ArgumentException: An item with the same key has already been added. at SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection.RemoteCall(String TypeName, String MethodName, Object Parameters, Boolean NullList, MarshalMessageType CallType) at SourceCode.Hosting.Client.BaseAPI.BaseAPI.RemoteSessionCall(String TypeName, String MethodName, Object Parameters, Boolean NullList) at SourceCode.Forms.Management.FormsManager.DoSessionCall(String method, Object parameters, Boolean nullList) 2. Deleting the View and its dependencies on the Target environment, and then re-deploying the package does not help. at SourceCode.Forms.Management.FormsManager.Deploy(String definition, String category, Boolean checkIn, Boolean skipReferenceValidation) at SourceCode.Runtime.Services.Forms.FormsSessionData.DeployView(View view, Boolean checkIn, Boolean skipReferenceValidation) at SourceCode.Runtime.Services.Forms.Services.BaseFormViewService`3.DeployAuthoringInstance(AuthoringType instance) at SourceCode.Runtime.Services.Forms.Services.BaseFormViewService`3.Deploy(IDeploymentContext context)"
- From the deployment logs, the full error message is as follows:-
- The issue persists after deleting the erroneous View along with its dependencies on the Target environment, and then re-deploying the package.
To resolve the issue, please apply the latest available 4.7 Cumulative Update which can be downloaded here