'Could not load file or assembly 'System.Text.Json, Version=5.0.0.0, 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

“22.4.4+Branch.support-v22.4.Sha.1090422ff8ac244a830d9e33650f90eb9cddd56a
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=5.0.0.0, 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.

cheers

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

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.

Hi

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

cheers

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

cheers

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 5.0.0.0 of System.Text.Json cannot be loaded? Isn’t package versioning always done with three digits (#.#.#)? I don’t think a version 5.0.0.0 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.

cheers

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.

cheers

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.