web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Solution Packager Pack Error

(0) ShareShare
ReportReport
Posted on by

I was trying to automate CRM deployment. I tried to use the solution packager and was able with the correct arguments was able to use the extract command and get the file structure out. The Issue I have is when I try to pack the data I get an error stating that the

plugin'RootComponentValidation': An item with the same key has already been added

When I check the log file for details of verbose it gives me 

2017-02-24 12:08:45.736 - Verbose Reading: C:\Users\Administrator\Desktop\TestSolutionPackage\SdkMessageProcessingSteps\{9fcadd51-913f-e511-80c8-005056825c44}.xml
2017-02-24 12:08:45.736 - Error Error occurred during execution of plugin 'RootComponentValidation': An item with the same key has already been added.
2017-02-24 12:08:45.736 - Error See log file 'C:\Users\Administrator\Desktop\verbose.txt' for details.
2017-02-24 12:08:45.736 - 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.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
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.<>c__DisplayClassa.<Run>b__4(IPackagePlugin p)
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)
2017-02-24 12:08:45.736 - Verbose CrmSvcUtil Runtime = 00:00:02.1380784

The process I went through was export a solution-> extract from zip -> attempt to pack into zip but error gets created

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    i found my issue that there was just a repeated id inside the solution.xml file . I think it is due to the fact that some of my forms have a field repeated twice in different locations for easier viewing

  • Community Member Profile Picture
    on at

    So I think you are saying the only solution is to not have repeated fields in the form? i.e. if it's in the header do not display it in the body?

  • Community Member Profile Picture
    on at

    yeah or you could just open the xml file and see the repeating id

  • Community Member Profile Picture
    on at

    Seems I am having the same issue. I have one big solution with almost everything in it. It cannot be packed with the same error message. After removing the entities from the solution it can be packed again. Do you had a proper way to identify the issue without checking every single ID for being a duplicate in the files? This really needs to be fixed!

  • Community Member Profile Picture
    on at

    Sorry I don't really have a better way other than to check the Id. My solution file wasn't that big so I never really looked for another way to optimize it.

  • Verified answer
    Community Member Profile Picture
    on at

    I finally identified the exact cause. The error is created by a bug in the CRM and based on the component type 60 - Interactive Dashboard. And here is what happens:

    If you create a solution, add an entity and its interactive dashboard(s) everything works fine with extracting and packing the solution until you import it to an organization.

    The CRM will create a duplicate entry in the list of RootComponents for every single interactive dashboard that is in the solution.xml file. It will not create a 3rd, 4th and so on entry if you keep on exporting and importing. Just a duplicate entry on the initial import.

    And than the packager will start to fail after exporting and extracting this solution when you try to pack it again due to this duplicate entry. This happens without any action of the solution packager. You can create a solution, add for example the account entity with such a dashboard and export it. The dashboard is listed once in the solution.xml. If you import the same solution without any action, export it again, than the entry is duplicated.

    Workaround: Don't add those dashboards to the solution or remove the duplicate entries every single time you update it in the TFS.

    This will at least narrow down the time to search for the duplicates if you know the rootcomponent type.

    Nevertheless the solution packager needs an update to handle interactivecentricdashboards properly as until now they are not extracted from the customizations.xml.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans