ThreadAbortException

Apr 22, 2010 at 12:26 AM
Edited Apr 22, 2010 at 12:28 AM

hey guys.

I created a plugin to track the change of lead entity. I have a custom entity called data audit and everytime when information has been updated in a lead, records will be created in the data audit entity to record the change.

i used a similar structure with mutex to lock the resource, however i am getting ThreadAbortExcetpion and it casued the plugin to fall over. Please see the details of the error

Web Service Plug-in failed in OrganizationId: 6679937d-b284-4c12-88fb-bbbc3ee691ca; SdkMessageProcessingStepId: 0a11770a-3e4c-df11-bc14-005056bc7fac; EntityName: lead; Stage: 50; MessageName: Update; AssemblyName: CRM.Plugin.DataAudit.DataAudit, CRM.Plugin.DataAudit, Version=4.0.0.0, Culture=neutral, PublicKeyToken=8d8511db0aab3aa1; ClassName: CRM.Plugin.DataAudit.DataAudit; Exception: Unhandled Exception: System.Threading.ThreadAbortException: Thread was being aborted.

   at System.Threading.WaitHandle.WaitOneNative(SafeWaitHandle waitHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)

   at System.Threading.WaitHandle.WaitOne(Int64 timeout, Boolean exitContext)

   at CRM.Plugin.DataAudit.DataAudit.Execute(IPluginExecutionContext context) in ...........

   at Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext context)

 The plugin is registerred at post stage, sync for lead update.

Any ideas?