Question
Publish to Robot Manager Failed.
We are getting "An item with the same key has already been added." in the Exception Information while deploying our code to Platform.
An item with the same key has already been added., Verbose Message: General Information
Diagnostic Info: Diagnostic.MachineName: Diagnostic.FullName: OpenSpan, Version=19.1.0.0, Culture=neutral, PublicKeyToken=f5db91edc02d8c5e Diagnostic.AppDomainName: DefaultDomain Diagnostic.WindowsIdentity: Diagnostic.ApplicationName: OpenSpan.Studio.Shell
Exception Information
1) Exception Information ********************************************* Exception Type: System.ArgumentException Message: "An item with the same key has already been added." ParamName: NULL Data: IDictionary (System.Collections.ListDictionaryInternal) with 0 items TargetSite: Void ThrowArgumentException(System.ExceptionResource) HelpLink: NULL Source: "mscorlib" HResult: -2147024809
StackTrace Information ********************************************* 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 OpenSpan.Studio.Solution.DesignProject.PublishPackageToManagementConsole(String packageName, Byte[] packageData, List`1 profiles, String packageComment)
This usually happens when you are publishing a version of a package you have already published. If you need to overwrite a version, delete it from both the package server and Robot Manager and then publish. If the version number can be changed, simply alter the version number in the startup project of your solution and publish again.