web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Error : "Could not load file or assembly 'System.Text.Json "when I try to run custom workflow that uses it

(0) ShareShare
ReportReport
Posted on by 30

Hello,

When I try to run my custom workflow code that uses the reference System.Text.Json to deserialize a Json file, I get this error. If I understand correctly this is not supported inside CRM? I tried googling it, but I got a lot of mixed answers. Some where about using Newtonsoft.Json with ILmerge. Some other said that I Newtonsoft is not supported, but that System.Text.Json should be fully supported. So my question is how do I deserialize a json file in a custom workflow in CRM 2016?

Thank you

addition info:

System.Text.Json seems to require netcore version 4.6.1 so that's the one that I used.

I am using CRM 2016

Here is the error message:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): APISync.CRMConnector: System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.Detail:
<OrganizationServiceFault xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220956</ErrorCode>
<ErrorDetails xmlns:d2p1="">schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Unexpected exception from plug-in (Execute): APISync.CRMConnector: System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.</Message>
<Timestamp>2020-09-21T20:51:48.2706629Z</Timestamp>
<InnerFault i:nil="true" /

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    You can use Newtonsoft.Json library and merge it using ILmerge but as you mentioned it will be unsupported but it will work. If you want to use supported approach check following post - develop1.net/.../ILMergeNotSupported

  • Verified answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Check below blog which talks about deserializing json object in supported way without using newtonsoft dll.

    www.inogic.com/.../

    Please mark my answer verified if i were helpful

  • dev2143 Profile Picture
    30 on at

    Thank you I managed to make it work with DataContractJsonSerializer.

  • Bihar Profile Picture
    on at

    Will it support for nested JSON response

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 96 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans