Skip to content

System.Text.Json Not working on Azure Functions v3 #1898

@notaroobob

Description

@notaroobob

System.Text.Json 5.0.2 brings with it an update to System.Text.Encodings.Web of 5.0.1.

The Dot net Runtimes for Azure Functions (linux in my case) is not allowing any executable to fire up. Specifically it's throwing an error that System.Text.Encodings.Web 5.0.0 is not found (which is true because it's now 5.0.1). Trying to force an update to 5.0.1 for Encodings.Web via nuget packages did not resolve the issue.

Reverting to System.Text.Json 5.0.1 (and System.Text.Encodings.Web to 5.0.0) fixes the issue for now, but I'll be needing to walk on egg shells for the next couple of months until Dot Net 6 consolidates and ships as default for the greater azure eco system.

Configuration
Which version of .NET is the code running on? - dot net core 3.1
What OS and version, and what distro if applicable? - Locally Mac OS 11.3.1. Deployed to Linux Consumption Function Tier
What is the architecture (x64, x86, ARM, ARM64)? x64
Do you know whether it is specific to that configuration? Unknown, assumption is no
Regression?
Resolved via downgrading to System.Text.Json 5.0.1

Call Stack: RuntimeAssembly.InternalLoadAssemblyName() at REDACTED RuntimeAssembly.cs:line 345 Assembly.Load() AssemblyLoadContext.LoadFromAssemblyName() FunctionAssemblyLoadContext.TryLoadHostEnvironmentAssembly() at D:\a\1\s\src\WebJobs.Script\Description\DotNet\FunctionAssemblyLoadContext.cs:line 392 FunctionAssemblyLoadContext.Load() AssemblyLoadContext.ResolveUsingLoad() AssemblyLoadContext.Resolve() JsonPropertyInfo.GetPolicies() JsonPropertyInfo<KeyVaultSecretReference>.Initialize() JsonClassInfo.CreateProperty() JsonClassInfo.CreatePropertyInfoForClassInfo() new JsonClassInfo() JsonSerializerOptions.GetOrAddClass() JsonSerializerOptions.GetOrAddClassForRootType() ReadStack.Initialize() JsonSerializer.ReadCore<Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureKeyVault.KeyVaultSecretReference>() JsonSerializer.Deserialize<Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureKeyVault.KeyVaultSecretReference>() JsonSerializer.Deserialize<Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureKeyVault.KeyVaultSecretReference>() AzureKeyVaultKeyValueAdapter.<ProcessKeyValue>d__3.MoveNext() AsyncMethodBuilderCore.Start<Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureKeyVault.AzureKeyVaultKeyValueAdapter.<ProcessKeyValue>d__3>() AsyncTaskMethodBuilder<IEnumerable<KeyValuePair<string, string>>>.Start<Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureKeyVault.AzureKeyVaultKeyValueAdapter.<ProcessKeyValue>d__3>() AzureKeyVaultKeyValueAdapter.ProcessKeyValue() AzureAppConfigurationProvider.<ProcessAdapters>d__26.MoveNext() AsyncMethodBuilderCore.Start<Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.<ProcessAdapters>d__26>() AsyncTaskMethodBuilder<IEnumerable<KeyValuePair<string, string>>>.Start<Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.<ProcessAdapters>d__26>() AzureAppConfigurationProvider.ProcessAdapters() AzureAppConfigurationProvider.<SetData>d__25.MoveNext() AsyncMethodBuilderCore.Start<Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.<SetData>d__25>() AsyncTaskMethodBuilder.Start<Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.<SetData>d__25>() AzureAppConfigurationProvider.SetData() AzureAppConfigurationProvider.<LoadAll>d__20.MoveNext() AsyncTaskMethodBuilder<VoidTaskResult>.AsyncStateMachineBox<AzureAppConfigurationProvider.<LoadAll>d__20>.ExecutionContextCallback() ExecutionContext.RunInternal() AsyncTaskMethodBuilder<VoidTaskResult>.AsyncStateMachineBox<AzureAppConfigurationProvider.<LoadAll>d__20>.MoveNext() AsyncTaskMethodBuilder<VoidTaskResult>.AsyncStateMachineBox<AzureAppConfigurationProvider.<LoadAll>d__20>.MoveNext() AwaitTaskContinuation.RunOrScheduleAction() Task.RunContinuations() Task.FinishContinuations() Task.FinishStageThree() Task.FinishStageTwo() Task.ExecuteWithThreadLocal() Task.ExecuteEntryUnsafe() Task.ExecuteFromThreadPool() ThreadPoolWorkQueue.Dispatch() _ThreadPoolWaitCallback.PerformWaitCallback() [Native to Managed Transition]

Referencing original logged issue:
dotnet/runtime#52845

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions