根据this tutorial,我们在托管解决方案卸载期间遇到了问题。
几乎所有基本步骤都没问题
但是,当我们尝试删除持有者解决方案时发生无效参数异常。
CrmDiagTool跟踪详情:
Web Service Plug-in failed in SdkMessageProcessingStepId: {2A71496D-3F12-11DD-9BDE-0019B9312238}; EntityName: solution; Stage: 30; MessageName: Delete; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
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.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: Microsoft.Crm.CrmArgumentException: Cannot add to the Sys Admin Profile
at Microsoft.Crm.ObjectModel.FieldPermissionServiceInternal'1.Create(IBusinessEntity entity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.SolutionComponentUninstaller.Uninstall(ComponentTypeMapData componentTypeData, Guid componentObjectId, SolutionUninstallContext solutionUninstallContext)
at Microsoft.Crm.ObjectModel.UninstallHandler.CascadeUninstallToComponent(ComponentTypeMapData typeData, String[] conditionColumns, Object[] conditionValues, SolutionUninstallContext solutionUninstallContext)
at Microsoft.Crm.ObjectModel.FieldSecurityProfileUninstallHandler.CascadeUninstall(ComponentTypeMapData componentTypeData, Guid componentObjectId, SolutionUninstallContext solutionUninstallContext)
at Microsoft.Crm.ObjectModel.SolutionComponentUninstaller.Uninstall(ComponentTypeMapData componentTypeData, Guid componentObjectId, SolutionUninstallContext solutionUninstallContext)
at Microsoft.Crm.ObjectModel.TypeUninstallHandler.Uninstall(SolutionUninstallContext solutionUninstallContext)
at Microsoft.Crm.ObjectModel.SolutionUninstallService.Uninstall(ISolution solution, DynamicMetadataCache cache, ExecutionContext context)
at Microsoft.Crm.ObjectModel.SolutionServiceInternal'1.Delete(BusinessEntityMoniker moniker, ExecutionContext context)
Inner Exception: System.ArgumentException: Cannot add to the Sys Admin Profile
为了更清楚,我们假设在Create方法的Microsoft.Crm.ObjectModel.FieldPermissionServiceInternal类中的某处有“无法添加到Sys Admin Profile”消息的CrmArgumentException抛出。
这个问题可能是什么原因以及我们如何解决?
系统中只有一个现场安全配置文件(系统管理员)。
提前谢谢!
P.S。迁移到CRM 2016不是一种选择。
更新
以下是Microsoft.Crm.ObjectModel.FieldPermissionServiceInternal类中Create方法的有问题的代码:
public override BusinessEntityMoniker Create(IBusinessEntity entity, ExecutionContext context)
{
this.ValidateAttributeIsNonNull(entity, FieldPermissionServiceInternal<T>.ColumnNames.EntityName);
this.ValidateAttributeIsNonNull(entity, FieldPermissionServiceInternal<T>.ColumnNames.AttributeLogicalName);
this.ValidateAttributeIsNonNull(entity, FieldPermissionServiceInternal<T>.ColumnNames.FieldSecurityProfileId);
Guid profileId = (Guid) entity[FieldPermissionServiceInternal<T>.ColumnNames.FieldSecurityProfileId];
if (profileId == FieldLevelSecurityConstants.AdminProfileGuid)
throw new CrmArgumentException("Cannot add to the Sys Admin Profile");
...