Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

(0) ShareShare
ReportReport
Posted on by

We recently upgraded our environment from CRM 2016, to Dynamics 365. Then we noticed, for some workflows we had exceptions being thrown for various different reasons, and while they used to work, now they are always throwing the very unhelpful, System.AggregateException: One or more errors occurred. I've removed every all other variables and created a custom workflow assembly whose only line of code under the execute method is

throw new Exception("Exception being thrown");


Even just doing that I still get the same AggregateException.

Any thoughts on what's going on?

Some things of note, I use the XrmToolkit to push the code changes. I also tried adding a try catch, and I create an Email with the exception in the catch. This works, but the issue is we want the exception thrown, and if I add a throw exception in the catch it doesn't seem to be getting to it at all....

Totally perplexed with what's going on. Would love any thoughts

*This post is locked for comments

  • Suggested answer
    CharlotteS Profile Picture
    CharlotteS on at
    RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    Some messages are not supported for the SandBox environment. I had this error with the SetWordTemplate message, which I had to move out to the calling standard workflow, instead of putting it in the custom workflow.

  • RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    Hey Nikica,

    I was just about to comment here, I reached out to see if there was any news, and they said the product team had confirmed it is a bug and, "...the fix of this will be available in 8.2.1 version, which is to be released by Q1 this year. However, we are not aware of the exact ETA of the release as of now."

    So...good-ish news I guess....

    And ya I tried profiling using the Plugin Profiler as well and every thing seemed fine.

  • Nikica Profile Picture
    Nikica 311 on at
    RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    Any update from Microsoft?

    I'm getting this error on my workflow activity too. I tested the activity in CRM 2016 on-premise where it works well, but in Dynamics 364 online it fails.

    Also I'm unable to profile my workflow. The profiling exception is never thrown. I got the exception "One or more errors occured even for profiled workflow.

  • RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    So, I spoke with a support person at Microsoft, and after showing him the issue, he agreed it's bug and they're working on it

  • Kevin Grech Profile Picture
    Kevin Grech 380 on at
    RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    I can confirm this. After my last reply I also tested with the plugin registration tool (no effect) and now as you suggested also tested in an un-sandboxed environment which resulted in the correct error being displayed.

  • RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    Thanks for the responses, I tried just using the Plugin Registration tool as well and got the same results.

    However, I did find the issue goes away if I switch from Sandbox Isolation mode to none...but that's not a reasonable work around

  • Kevin Grech Profile Picture
    Kevin Grech 380 on at
    RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    I'm using the "Dynamics CRM 2013 Developer Tools" extension for visual studio to deploy (which worked great up to and including CRM 2016) on development and then export/import the solution to the live environment.

  • Nadeeja Bomiriya Profile Picture
    Nadeeja Bomiriya 6,804 on at
    RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    Hi Gorb,

    As per XrmToolKit web site, Dynamics 365 is not supported.  Contact them to find out if there's a updated version which supports Dynamics 365 (8.2).

    "XrmToolkit integrates directly into Visual Studio® 2012, 2013, and 2015 and is compatible with CRM 2011, 2013, 2015, and 2016 both Online and On-Premise."

    https://xrmtoolkit.com/

  • RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    Hey Kevin, do you use the Xrm Toolkit (formerly the CRM Solution Manager) to update your assemblies by chance?

  • Kevin Grech Profile Picture
    Kevin Grech 380 on at
    RE: Unexpected exception from plug-in (Execute): CustomWorkflow: System.AggregateException: One or more errors occurred.

    We're having the same error in our system. We just upgraded from CRM 2011 all the way to Dynamics 365 (On-Premise). In our case, we're throwing a normal InvalidPluginExecutionException which is caught and thrown back a few times until it's shown to the user.

    According to our trace logs, the exception is somehow being caught as a FaultException (of type OrganizationServiceFault) and then CRM throws us a System.AggregateException.

    NB. This was working well in CRM 2011 and CRM 2016

    I would like some answers as well.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans