'Could not load file or assembly 'System.Text.Json, Version=, Culture=neutral, PublicKeyToken=

Hi Everyone,

has anyone encountered this error before and found a solution?

I took all the workflow files from a Re-Framework-based project and pasted them into a library project. The library project and the Re-Framework-based project have exactly the same dependencies. When I try to publish the library to the Orchestrator I get a popup saying

Compilation failed or was cancelled.”

and the output panel reads

“Unexpected error has occurred during the library compilation process: Unable to create activity builder for ReadMailsFromFolder.xaml. Reason was 'Could not load file or assembly 'System.Text.Json, Version=, Culture=neutral, PublicKeyToken=xxx”

I tried out the approach in this Thread but couldn’t get rid of the error.

The project panel indicates that a lot of the packages I imported themselves depend on the package “System.Text.Json” but the majority of these version are lower than 5.0 . Do they need to get updated and how can this get done?

Thanks for your support.

Hi @Gruen_Philipp ,

Degrade your Microsoft office 365 to 1.11.1 which is one stable version . It worked for us. Please try the same.


Have you got ‘nuget.org’ in definied package sources?
System.Text.Json exists in this source with many newer versions.

If not, click it and try to download your packages again

Hi Anil,

yeah we tried that, but this led to another error message keeping us from publishing. Thanks.


we got exactly this thread, but only under ‘Default Package Sources’.

Hi @Gruen_Philipp ,

The other error message would be because of an upload activity that you used or find files as the variable type in 1.14.1 and 1.11.1 are different. You can get rid of that by recreating the variable in that activity


I removed all activities that Studio marked as invalid and took the corresponding activities from the package version that I downgraded to. There were no more validation errors when I hit publish and yet again the publish procedure aborted with a new error I have never seen before.

When I remove the ‘Microsoft office 365’ package entirely from my library project I am able to publish without any errors. So the cause of the problem is related to this package. But I need certain activities from the package inside my library so removing the package permanently is no solution.

Hi @Gruen_Philipp

Try more lower versions if you ahve option to


It seems like the source of the problem is the activtiy ‘Reply to Mail’ from the ‘Microsoft office 365’ package version 1.14.1 . Throughout my library three different activties from this package (GetMail, Movemail and Replymail) are used. I removed all of them then added a GetMail and a Movemail activtiy and published sucessfully. I then added a ReplyMail activtiy and published again, but this time the original error that I opened this thread for occured again and I couldn’t publish.

Isn’t it strange that the error message indicates that the version of System.Text.Json cannot be loaded? Isn’t package versioning always done with three digits (#.#.#)? I don’t think a version of System.Text.Json even exists.

Hi @Gruen_Philipp

Agreed with you. Few days back even we faced the same. We restarted, recreated the sequences as well. It occurred for specific user and then when we used 1.11.1 and recreated whole of the xaml then it stopped. Not sure if this is of any help.


Thanks. I tried to rebuilt the affected xaml on 1.11.1 version, but am getting the same error upon publishing. I am starting to think that there’s nothing I can do about this issue. Could it be that this is a bug inside the Office 365 package 1.14.1 version?

Hi @Gruen_Philipp

1.14.1 is definitely having a bug. But we faced same so try restarting the machine / using another machine or send the xaml to other developers and see if they are facing issue once degraded. Even we took 2 days to solve trying all but at the end once the issue is gone it worked.

One thing that we tried is we went to .nuget file of other machines and got the system.text.json and copied to our machine. You can try the same.


I could solve the issue by converting the library project from ‘Windows - Legacy’ to ‘Windows’ compatibility mode.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.