question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Help wanted with update to 4.7.2 System.Text.Json

See original GitHub issue

Hello, Help wanted.

I’m developing Swagger documentation package for Azure Functions, which is dependent on

Microsoft.Azure.WebJobs.Extensions.Http
Microsoft.Azure.Functions.Extensions

packages

Currently, it’s not possible for me to update the version System.Text.Json. from 4.7.0 => 4.7.2 (or 4.7.1, 5.0.0) as I’m getting the following error:

'Method not found: 'Void Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter..ctor(System.Text.Json.JsonSerializerOptions)'.'

The issue is described here: https://github.com/vitalybibikov/AzureExtensions.Swashbuckle/issues/30

Repro steps

Provide the steps required to reproduce the problem

  1. Download the repo (https://github.com/vitalybibikov/AzureExtensions.Swashbuckle/tree/dev)

  2. Update from 4.7.0 to 4.7.2 both TestFunction and AzureFunctions.Extensions.Swashbuckle

    • When only AzureFunctions.Extensions.Swashbuckle is updated to 4.7.2, while TestFunction is using 4.7.0 it works.
  3. Start the project.

Expected behavior

Works

Actual behavior

'Method not found: 'Void Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter..ctor(System.Text.Json.JsonSerializerOptions)'.'

image

Related information

I was trying to investigate it is much as possible in here => https://github.com/vitalybibikov/AzureExtensions.Swashbuckle/tree/branch/trying-update-json

I have substituted SystemTextJsonOutputFormatter with my version => SystemTextJsonOutputFormatter2, which uses it’s own TranscodingWriteStream, as they are both sealed and internal, it was not possible to override anything.

Now it fails during function call => http://localhost:7071/api/Swagger/ui though with the same error:

image

I think, that is related to the fact that one of these projects has not been updated fully.

  • System.Text.Json 4.7.2

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
fabiocavcommented, Mar 24, 2021

Apologies for the delayed response here.

This is a reasonable request. I’ll move it to the host repo, where we’d have to address this (that’s the component performing the unification) and track it for the next sprint.

2reactions
DarinMacRaecommented, Jan 21, 2022

Our team did the same as @johnnyreilly originally did but we are targeting https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi/1.0.0.

It wasn’t an easy transition from using @vitalybibikov 's packages, and we still have a lot of attribute migrations left but so far so good. Any issues we ran into were acceptable since at least we have docs up and running again.

FWIW, we also took advantage of this overhaul to rethink our strategy and ended up moving all documentation for all APIs into a single Swagger-Doc specific project/repo. The documentation process and rendering can now have whatever dependencies it wants without having to argue with production operational needs. Having a production website failing to run because of a documentation library is unacceptable for us.

Overall, this has been a win for our team in many ways and I wish I had thought of it sooner. Again, any issues we’ve run into have been few and are acceptable.

HTH

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help wanted with update to 4.7.2 System.Text.Json #7248
Hello, Help wanted. I'm developing Swagger documentation package for Azure Functions, which is dependent on Microsoft.Azure.WebJobs.
Read more >
System.Text.Json 4.7.2
Provides high-performance and low-allocating types that serialize objects to JavaScript Object Notation (JSON) text and deserialize JSON ...
Read more >
Which .Net Framework needed to use System.Text.Json
I need to de-serialize into DataSet. I have come accross with System.Text.JSON. Currently I have 4.5.2 .NET Framework. Which .Net Framework…
Read more >
c# - How do I fix the error "Could not load file or assembly ' ...
Simply update the Nuget package or System.Text.Json to 4.7.2 and onwards. Share.
Read more >
Regarding Use of System.Text.JSON in .NetFramework 4.7.2
Hi, I have created one C# dll of .Net Framework 4.7.2. In this DLL, I want to deserialize the JSON file and when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found