原因为CRMAppPool选择了一个域用户,然后异步服务的用户执行会有问题
at CrmException..ctor(Int32 errorCode, Object[] arguments) ilOffset = 0x36
at SecurityLibrary.GetPrivilegedUserCallerAndBusinessGuidsFromThread(WindowsIdentity identity, IOrganizationContext context) ilOffset = 0x6F
at CrmWindowsIdentity.DoRecognizeUser(String userToken, Guid organizationId, LocatorServiceContext locatorServiceContext) ilOffset = 0x0
at BaseCrmIdentity.RecognizeCrmUser(Guid organizationId, LocatorServiceContext locatorServiceContext) ilOffset = 0x49
at BaseCrmIdentity.RecognizeCrmUser(Guid organizationId) ilOffset = 0x0
at InternalSdkContextInitializer.SetHttpContext(WindowsIdentity windowsIdentity, Guid organizationId, Guid callerId) ilOffset = 0x67
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request) ilOffset = 0x12
at WorkflowExpansionPlugin.Execute(IServiceProvider serviceProvider) ilOffset = 0x5B
at V5ProxyPlugin.Execute(IServiceProvider serviceProvider) ilOffset = 0x63
at EventOperation.InvokePlugin(AsyncExecutionContext context, IPlugin pluginInstance) ilOffset = 0xF
at EventOperation.InternalExecute(AsyncEvent asyncEvent) ilOffset = 0x155
at AsyncOperationCommand.Execute(AsyncEvent asyncEvent) ilOffset = 0x4E
at PoolHandler.ProcessAsyncEvent(IGenericEventData eventData) ilOffset = 0x139
at <>c__DisplayClass4.<.ctor>b__2(IServiceOperation operation) ilOffset = 0x0
at FaultToleranceBehavior.Execute(ServiceOperationAction operation, IServiceOperation operationParameter) ilOffset = 0x18
at MonitoredOperation.Execute() ilOffset = 0xD
at ThreadPoolQueueExecutionEngine.InvokeNextOperationInThreadPool(Object state) ilOffset = 0xC
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) ilOffset = 0x71
at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() ilOffset = 0x23
at ThreadPoolWorkQueue.Dispatch() ilOffset = 0x81
at _ThreadPoolWaitCallback.PerformWaitCallback() ilOffset = 0x51
>Crm Exception: Message: The user Id is invalid., ErrorCode: -2147214049