Workflow Error: Could not load type 'System.Buffers.Text.Utf8Formatter' from assembly

We were using Pre-Image in our workflow and returning an attribute value of this pre-image as an output parameter.

Suddenly we were getting the below error:

An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): MyProject.Workflow.Value: System.Exception: Could not load type 'System.Buffers.Text.Utf8Formatter' from assembly 'MyProject.Workflow' because the method 'TryFormatDecimalG' has no implementation (no RVA). 

The code was like this:

Entity preImageEntity = crmWorkflowContext.WorkflowExecutionContext.PreEntityImages.Contains("PreBusinessEntity") ? crmWorkflowContext.WorkflowExecutionContext.PreEntityImages["PreBusinessEntity"] : null;

StringAttrValue.Set(context, preImageEntity.Attributes[AttributeName.Get(context)]);

To resolve this issue, We have to implicitly cast attribute name "To String" as shown below

StringAttrValue.Set(context, preImageEntity .Attributes[AttributeName.Get(context)].ToString());


Cheers,

Rocker

Comments

Popular posts from this blog

Power Automate: Create and attach Dataverse note or activity with an entity record through MS flow

{Error:Fetch XML}: The date/time format is not valid, or the value is outside the supported range

How to set privilege for Activity Attachment (activitymimeattachment) in Dynamics 365 or PowerApps