locked
SolutionPackager issue during repack: "Error occurred during execution of plugin 'RootComponentValidation': An item with the same key has already been added RRS feed

  • Question

  • Hi,

    I'm new to SolutionPackager in CRM 2011 and excited to use it for our project and our team.

    I was able to successfully Extract the Solution (zip) file into a folder. When I try to repack it into a zip file I found the below error:

     "Error occurred during execution of plugin 'RootComponentValidation': An item with the same key has already been added"

    Approaches tried:

    Found one folder for a plugin twice. So, I removed one folder which I felt is old from the version control. But it did not resolve the issue. So, I removed both folders and tried again. But the same error persists.

    Any help or pointers in this regard would be greatly appreciated.

    Thanks,

    Manoj

    Monday, July 8, 2013 3:01 PM

All replies

  • This can be tough to pinpoint, but your best bet is to run the solutionpackager tool with the /log and /errorlevel settings specified.  Set the error level to Verbose and you should be able to get more information from what is logged in the specified log file.  It usually will point you to the culprit.

    Nick

    Monday, July 8, 2013 5:00 PM
  • Thanks Nick for your quick help!

    I tried with error level as Verbose, it did give me more details. But, it still does not point me to the actual error.

    Any other thoughts would be really helpful!

    Thanks,

    Manoj

    Monday, July 8, 2013 5:54 PM
  • Did you log the errors to a file and look at the log file?  There is more detail in the log file than get echoed to the console window.

    Nick

    Monday, July 8, 2013 5:55 PM
  • Hi Nick,

    I did the logging of errors to a file by having error level as "Verbose".

    Found the following but it does not give me pointers. Please help with your thoughts by looking at the message below:

    005056B1006A/UpdatePrimaryComplainant.dll
    2013-07-08 13:50:55.041 - Info  - UpdatePrimaryComplaint, Version=1.0.15.0, Culture=neutral, PublicKeyToken=b1a9376d4bac16d4
    2013-07-08 13:50:55.042 - Verbose Reading: c:\extracted\PluginAssemblies/UpdatePrimaryComplaint-27D1930B-CEF3-4B3B-9EF2-3E19E6F9ED7B/UpdatePrimaryComplaint.dll
    2013-07-08 13:50:55.047 - Info  - UpdatePrimaryComplaint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=83e7cc52d220f214
    2013-07-08 13:50:55.047 - Verbose Reading: c:\extracted\PluginAssemblies/UpdatePrimaryComplaint-D479BE04-570F-E111-9510-005056B1006A/UpdatePrimaryComplaint.dll
    2013-07-08 13:50:55.053 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{063df353-df11-e111-9f21-001d09133521}.xml
    2013-07-08 13:50:55.054 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{148b68dc-0afb-e011-b44f-001d09133521}.xml
    2013-07-08 13:50:55.054 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{189b31e4-54f5-e011-b57f-001d09133521}.xml
    2013-07-08 13:50:55.055 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{2a4049c1-de11-e111-9f21-001d09133521}.xml
    2013-07-08 13:50:55.055 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{390a89c0-89ea-e011-ab40-001d09133521}.xml
    2013-07-08 13:50:55.056 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{54da10f9-1bfe-e011-b44f-001d09133521}.xml
    2013-07-08 13:50:55.057 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{56734df2-e211-e111-9f21-001d09133521}.xml
    2013-07-08 13:50:55.057 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{5e7f40ef-d5e9-e011-aa70-001d09133521}.xml
    2013-07-08 13:50:55.058 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{601dd530-5cf5-e011-b57f-001d09133521}.xml
    2013-07-08 13:50:55.058 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{684aa10d-06f3-e011-b57f-001d09133521}.xml
    2013-07-08 13:50:55.059 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{7028541f-3614-e111-95a8-001d09133521}.xml
    2013-07-08 13:50:55.059 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{7634734e-e311-e111-9f21-001d09133521}.xml
    2013-07-08 13:50:55.060 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{78009dde-a1f5-e011-b580-001d09133521}.xml
    2013-07-08 13:50:55.061 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{7b60b8b1-4a22-e111-8bc5-001d09133521}.xml
    2013-07-08 13:50:55.061 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{7c14e434-9ff5-e011-b580-001d09133521}.xml
    2013-07-08 13:50:55.062 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{7ffe3cde-e9e8-e011-be3e-001d09133521}.xml
    2013-07-08 13:50:55.063 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{809e1d6a-57eb-e011-ab40-001d09133521}.xml
    2013-07-08 13:50:55.064 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{88b3b67d-1c1c-e111-95a8-001d09133521}.xml
    2013-07-08 13:50:55.064 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{890fec70-f90c-e111-8932-001d09133521}.xml
    2013-07-08 13:50:55.065 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{8a614d2b-f30c-e111-8932-001d09133521}.xml
    2013-07-08 13:50:55.065 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{96785a76-e311-e111-9f21-001d09133521}.xml
    2013-07-08 13:50:55.066 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{a89427a0-57eb-e011-ab40-001d09133521}.xml
    2013-07-08 13:50:55.066 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{b0f0b9e2-d4f4-e011-b57f-001d09133521}.xml
    2013-07-08 13:50:55.067 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{b4bd2a99-49eb-e011-ab40-001d09133521}.xml
    2013-07-08 13:50:55.067 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{d46276d6-49eb-e011-ab40-001d09133521}.xml
    2013-07-08 13:50:55.068 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{daf5afc4-e211-e111-9f21-001d09133521}.xml
    2013-07-08 13:50:55.068 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{f6ebba9a-7eea-e011-ab40-001d09133521}.xml
    2013-07-08 13:50:55.069 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{fea6a753-a7f4-e011-b57f-001d09133521}.xml
    2013-07-08 13:50:55.070 - Verbose Reading: c:\extracted\SdkMessageProcessingSteps\{ffcff8c3-c5fe-e011-b44f-001d09133521}.xml
    2013-07-08 13:50:55.087 - Error Error occurred during execution of plugin 'RootComponentValidation': An item with the same key has already been added.
    2013-07-08 13:50:55.088 - Error See log file 'c:\zipped\extract.log' for details.
    2013-07-08 13:50:55.092 - Error Microsoft.Crm.Tools.SolutionPackager.PluginExecutionException: An item with the same key has already been added. ---> System.ArgumentException: An item with the same key has already been added.
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Microsoft.Crm.Tools.SolutionPackager.Plugins.RootComponentsValidation.GetRootComponents(SolutionInformation solution)
       at Microsoft.Crm.Tools.SolutionPackager.Plugins.RootComponentsValidation.BeforeWrite(PluginContext pluginContext)
       at Microsoft.Crm.Tools.SolutionPackager.SolutionPackager.InvokePlugin(PluginConfigurationElement pluginConfig, Action`1 action)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Tools.SolutionPackager.SolutionPackager.InvokePlugin(PluginConfigurationElement pluginConfig, Action`1 action)
       at Microsoft.Crm.Tools.SolutionPackager.SolutionPackager.Run(IPackageReader reader, IPackageWriter writer)
       at Microsoft.Crm.Tools.SolutionPackager.SolutionPackager.Run()
       at Microsoft.Crm.Tools.SolutionPackager.Program.Main(String[] args)

    Thanks,

    Manoj

    Monday, July 8, 2013 6:58 PM
  • I would look in your solution.xml file to see what the next component being processed is.  I have solved these errors in the past but it takes a lot of digging and trial and error.  I believe the packager iterates through each of the solution components in the solution.xml file.  If you look at the next item after the last GUID processed, i.e. {ffcff8c3-c5fe-e011-b44f-001d09133521} in the solution XML file, that might be the element causing the issue.

    Nick

    Monday, July 8, 2013 7:23 PM
  • Thanks Nick for your time, well appreciated!

    I did go through Solution.xml and found the below

     <MissingDependencies>
          <MissingDependency>
            <Required key="0" type="70" displayName="System Administrator" solution="System" id="{572329c1-a042-4e22-be47-367c6374ea45}" />
            <Dependent key="0" type="70" displayName="System Administrator" id="{572329c1-a042-4e22-be47-367c6374ea45}" />
          </MissingDependency>

    Not sure if the above message gives any clue. Please advise with your help.

    Thanks,

    Manoj

    Monday, July 8, 2013 7:26 PM
  • Hi Manoj...

    Did you fing the answer? I'm facing the same issue...

    Thanks,

    JohannQ


    • Edited by JohannQ Thursday, June 19, 2014 1:57 PM
    Thursday, June 19, 2014 1:56 PM
  • Is anybody got the answer? I am facing the same problem. I am extracting and Packing 'Default' solution of CRM while packing two plugin dlls.

    But if I add both dlls in separate solution and try to run solution packager it is working. 

    Not understand why in default solution it is giving error while packing same plugins.

    Thanks,

    Anand

    Wednesday, June 25, 2014 9:03 AM
  • I found the answer. It is because of managed Reports in Default solution.

    -Anand

    Wednesday, June 25, 2014 3:31 PM
  • does anybody have an answer? 

    Thanks,

      Hayden 

    Friday, February 24, 2017 4:37 PM
  • If anyone else has this issue check this https://community.dynamics.com/crm/f/117/t/207948 . You might have a duplicated row due to the solution having a dashboard in it
    Monday, February 27, 2017 5:21 PM