System.Text.Json 5.0.2 assembly in project dependencies in version 0.5.10 - Impacting Azure Functions v3 + Microsoft.Net.Sdk.Functions .12,.13 Nuget packages. #270
Replies: 23 comments
-
We have been seeing this with direct rebuilds as we have been cleaning up dependencies, which is where our new compile + run tests have come in to work though build issues. If your seeing at runtime ( which you indicate ) can you give me an example of what method your calling that is causing it to appear, or is it appearing on Login? If your seeing it on build, flushing out your Obj folders usually clears the issue. System.Text.Json 5.0.2 and its dependencies go all the back to .net core 3.0, so that should not be the challenge there.. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@drivardxrm We were able to get a repro of the permissions lib on netcore 3.1 which we think is a bug in a supporting lib from the dataverse server we are checking into and should be able to fix soon. But not of the System.TextEncodings issue your seeing. Is it possible for you to share a local repro? |
Beta Was this translation helpful? Give feedback.
-
Hi @MattB-msft , the System.Text.Encodings.Web error happens on a HTTP trigger function I cannot share the actual repo but I will try to create a simple test repo tonight and I will gladly share with you. Thanks, |
Beta Was this translation helpful? Give feedback.
-
@drivardxrm |
Beta Was this translation helpful? Give feedback.
-
@MattB-msft , yes its windows |
Beta Was this translation helpful? Give feedback.
-
@drivardxrm Which functions version?
and things are working as expected. |
Beta Was this translation helpful? Give feedback.
-
@drivardxrm are you getting the same behavior with Dataverse.Client 5.10?
|
Beta Was this translation helpful? Give feedback.
-
yes, I have the problem only with 0.5.10 on the image in the comment, I have reverted back to 0.5.7, I shouldnt have put this. sorry for the confusion |
Beta Was this translation helpful? Give feedback.
-
Ok the issue is actually with the Microsoft.Net.Sdk.Functions Nuget package... 3.0.13 causes it, 3.0.3 works.. checking into the 4.0 version now, |
Beta Was this translation helpful? Give feedback.
-
@drivardxrm Specifically its the use of System.Text.Json, 5.0.1 is looking for assembly versions 5.0.0.0, and 5.0.2, is looking for assembly versions 5.0.0.1 ( yes that's weird... ) Looks like our hosts are caught in the crossfire between changes in the System.Text.Json and System.Text.Endcodings.* assemblies in .net . We are talking to the .net team about this now and will let you know when we know and or downgrade if we can. Short term though, I would suggest downgrading to use Microsoft.Net.Sdk.Functions at most 3.0.11, that will clear the issue for you right now. Or You can use .UseWebApi = false on the connection, and it will disable the codepath that is causing this issue all up, and you can use current version of Microsoft.Net.Sdk.Functions. |
Beta Was this translation helpful? Give feedback.
-
Might be related to this issue closed as by design: |
Beta Was this translation helpful? Give feedback.
-
One more follow-up to this.. we just retested with .net 6.x RC and all versions of the Functions SDK up to 13. they all work. |
Beta Was this translation helpful? Give feedback.
-
Can't really confirm this. For me this seems to be clearly the issue of the Dataverse package. As the initial screenshot reveals, there is a 5.x package referenced for .net core 3.1. It's been the same thing with the reference to This stuff always causes issues with the in-process model of Azure functions. It's the same issue with the 5.x versions of Logging and DependencyInjection which simply cannot be used in a v3 Azure function. Simply fix your nuspec and release and updated version to solve this issue. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@s-bauer, wish it was that easy :( Per Azure function statement's they dropped the assembly mentioned in CVE-2021-26701 from their .12 and .13 support packages, thus breaking anything that depends on System.Text.Json 5.0.2 and its dependencies Please also keep in mind that the version number attached to the Nuget package versions for any of the System.* nuget packages are not directly related to the version of .net. They are related to the release wave that the .net team is doing. Right now the guidance I can provide is to downgrade Microsoft.Net.Sdk.Functions to .11 or lower for the v3 functions area until the System.Text.Json 6.0 ships. |
Beta Was this translation helpful? Give feedback.
-
@MattB-msft The CVE you've linked states that version 4.7.2 is safe as well. Isn't it possible to just use that one instead of 5.0.2? |
Beta Was this translation helpful? Give feedback.
-
We are actively discussing it with the dataverse teams |
Beta Was this translation helpful? Give feedback.
-
Any update on this topic? |
Beta Was this translation helpful? Give feedback.
-
Not at this time. Its a fairly complicated change ( going backward on a dependency ) in the server platform. In the mean time.. the guidance we provided above for functions is what you should use for now. |
Beta Was this translation helpful? Give feedback.
-
@drivardxrm FYI, I updated the title of this item to help other searchers find the issue. |
Beta Was this translation helpful? Give feedback.
-
Hello, I can confirm that upgrading to .NET 6 and Microsoft.NET.Sdk.Functions Version 4.1.0 resolved this issue for me. I hope it helps someone else. |
Beta Was this translation helpful? Give feedback.
-
Moving this to Discussions / Q/A area at this point... 0.6 + is shipping with System.Text.Json 6.0 as a dependency. |
Beta Was this translation helpful? Give feedback.
-
Hi,
it seems that there is a dependency on a .NET 5 package in the latest version (0.5.10)
In an Azure Function project (.NET Core 3.1) I receive this error at runtime whenever I make a call using the new package.
One or more errors occurred. (Could not load file or assembly 'System.Text.Encodings.Web, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.)
I have no such issues with earlier version (0.5.7)
Might be because of the System.Text.Json that seems to have changed from 4.72 to 5.0.2

Beta Was this translation helpful? Give feedback.
All reactions