CRM Organization Importing getting fail with Below error.Please help to resolve issue..
ystem.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction ---> Microsoft.Crm.CrmException: Error in Action: Bin\Microsoft.Crm.Setup.DiffBuilder.dll:Pass2 on attempt 3. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Crm.CrmException: Failed to process metadata description - Name: PrivilegeObjectTypeCode, ID: dda1ef28-e43d-4c8b-8934-19cdade41542 ---> 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.Metadata.MetadataContainer.AddPrivilegeObjectTypeCode(IPrivilegeObjectTypeCodeDescription privilegeOtc)
at Microsoft.Crm.Metadata.MetadataContainer.AddDescription(IMetadataDescription description, String name)
--- End of inner exception stack trace ---
at Microsoft.Crm.Metadata.MetadataContainer.AddDescription(IMetadataDescription description, String name)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.LoadDescriptions(IMetadataContainer metadataContainer, Dictionary`2 descriptionsCollection)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.LoadContainerData(IMetadataContainer metadataContainer, Dictionary`2 descriptionsCollection, List`1 privilegesCollection, List`1 deletedDataCollection)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.LoadContainerData(LoadMasks masks, ISqlDataAccess crmSqlDataAccesser, IMetadataContainer metadataContainer, List`1 fillProperties, CounterList counter)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.BuildMetadataContainerFromDatabaseInternal(LoadMasks masks, ISqlDataAccess crmSqlDataAccesser, CounterList counter, Boolean isInStagedContext, BuildTableFillPropertiesTemplate buildTableFillProperties)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.BuildMetadataContainerFromDatabase(LoadMasks masks, ISqlDataAccess crmSqlDataAccesser, CounterList counter, Boolean isInStagedContext)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.<>c__DisplayClass38_0.<LoadMetadataContainerFromDatabase>b__0(ISqlDataAccess crmSqlDataAccesser)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadMetadataContainerFromDatabaseInternal(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, CounterList counter, BuildMetadataContainerFromDatabaseTemplate buildMetadataContainerFromDatabase, Nullable`1 optionalVersionNumberToFilterResults)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadMetadataContainerFromDatabase(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, CounterList counter, Nullable`1 optionalVersionNumberToFilterResults, Boolean isInStagedContext)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabaseInternal(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, CounterList counter, Boolean isInStagedContext)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabase(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, CounterList counter, Boolean isInStagedContext)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabase(LoadMasks masks, CounterList counter)
at Microsoft.Crm.Metadata.DynamicMetadataCacheFactory.LoadMetadataCache(LoadMethod method, CacheType type, LoadMasks masks, IOrganizationContext context)
at Microsoft.Crm.Setup.MetadataCacheLoadHelper.LoadCacheFromDatabase(CacheType existingMetadataCacheType, LoadMasks masks, String connectionString, Guid organizationId)
at Microsoft.Crm.Setup.DiffBuilder.Pass2Internal(String metadataLocation, String languageCode, Boolean recalculateDependencies, String targetVersion)
at Microsoft.Crm.Setup.DiffBuilder.Pass2(String metadataLocation, String languageCode, String targetVersion)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.Crm.Setup.Database.DllMethodAction.Execute(Guid organizationId, Nullable`1 operationType)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass85_1.<ExecuteReleases>b__0()
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass85_1.<ExecuteReleases>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.installInternal(Boolean isInstall, Int32 languageCode)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass92_0.<Install>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass94_0.<InstallUpdate>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Common.Update.DBUpdateDatabaseInstaller.ApplyDBUpdates(Guid orgId, Nullable`1 operationType, Int32 langCode, String releaseFilePath)
at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdatesInternal(Guid orgId, String orgUniqueName, String releaseFilePath, OrganizationOperationType operationType, Boolean isXrm, Int32 langCode)
at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdates(Guid orgId, String orgUniqueName, OrganizationOperationType operationType, Boolean isXrm, Int32 langCode)
at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.Do(IDictionary parameters)
at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteActionHelper(CrmAction action, IDictionary parameters, Boolean undo)
--- End of inner exception stack trace ---
at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteActionHelper(CrmAction action, IDictionary parameters, Boolean undo)
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Shared.Installer.<>c__DisplayClass83_0.<DoAction>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Shared.Installer.<>c__DisplayClass67_0.<Install>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
at Microsoft.Crm.Tools.Admin.OrganizationDBUpdateInstaller.Execute()
at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, ICollection`1 users, MultipleTenancy multipleTenancy, Boolean patchOnImport, OrgDbUpdateMode orgDbUpdateMode)