An item with the same key has already been added

Problem

Drop downs with dynamics bind in ZervicePoint does not work.

The event log contains the following error:

Message: There was an error trying to execute: 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 Zipper.ZervicePoint.ProvisioningSystem.ProviderRegistry.Initialize()  
  at Zipper.ZervicePoint.ProvisioningSystem.ClientWebService.Services.ProviderService.CallProvider(String serviceName, String arguments, String data, String rawToken, String callback)
Category: Provisioning.Provider

Solution

The error is caused if you have referenced a PowerShell provider multiple times.

Check the provider.xml files in ClientWebService and ProvisioningSystem. Remove any duplicate references to PowerShell providers.

In the example below both xml files contain references to the same PowerShell provider.

activedirectory.provisioningsystem.providers

  <provider name="MS Active Directory">
    <assembly type="Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.PowerShellEngine" assemblyFile="C:\Program Files\Zipper\ZervicePoint\ProvisioningSystem\Providers\PowerShell\Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.dll" />
    <configuration>
      <add key="scriptpath" value="C:\Program Files\Zipper\ZervicePoint\Provider extensions\Active Directory\Activities\" />
      <add key="DomainController" value="DC01.domain.local" />
      <add key="SearchBase" value="OU=Demo,DC=domain,DC=local" />
      <add key="SharedFolderProperty" value="info" />
      <add key="SharedFolderReadGroup" value="R-" />
      <add key="SharedFolderWriteGroup" value="RW-" />
      <add key="SoftwareGroupAttribute" value="ExtensionAttribute3" />
      <add key="SoftwareGroupValue" value="software" />
      <add key="UICulture" value="en-US" />
    </configuration>
  </provider>

misc.providers

  <provider name="MS Active Directory">
  <assembly type="Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.PowerShellEngine" assemblyFile="C:\Program Files\Zipper\ZervicePoint\ProvisioningSystem\Providers\PowerShell\Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.dll" />
  <configuration>
    <add key="scriptpath" value="C:\Program Files\Zipper\ZervicePoint\Provider extensions\Active Directory\Activities\" />
    <add key="DomainController" value="DC01.domain.local" />
    <add key="SearchBase" value="OU=Demo,DC=domain,DC=local" />
    <add key="SharedFolderProperty" value="info" />
    <add key="SharedFolderReadGroup" value="R-" />
    <add key="SharedFolderWriteGroup" value="RW-" />
    <add key="SoftwareGroupAttribute" value="ExtensionAttribute3" />
    <add key="SoftwareGroupValue" value="software" />
    <add key="UICulture" value="en-US" />
  </configuration>
  </provider>

Troubleshooting guidelines