'Problem with Microsoft.CodeAnalysis on Visual Studio 2019 16.11.6 AFTER install Visual Studio 2022

I am receiving on Visual Studio 2019 16.11.6 these suspicious warnings (Version=42.42.42.42) AFTER install Visual Studio 2022. Any idea?

Warning CS8032 An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from C:\Users\xyz.nuget\packages\system.text.json\6.0.0\analyzers\dotnet\roslyn4.0\cs\System.Text.Json.SourceGeneration.dll: Der Typ "Microsoft.CodeAnalysis.IIncrementalGenerator" in der Assembly "Microsoft.CodeAnalysis, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35" konnte nicht geladen werden.



Solution 1:[1]

From GitHub issues:

Actual behavior

The build produces the following warning (or error if TreatWarningsAsErrors is enabled)

Known Workarounds

You can pass DisableSystemTextJsonSourceGenerator to disable all versions of the generator: dotnet build -p:DisableSystemTextJsonSourceGenerator=true.

Based on Microsoft Q&A - I solved this issue on my machine by updating Visual Studio 2019 to the latest version (16.11.13).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Natan