I'm having the same issue reported here: https://github.com/dotnet/runtime/issues/61602#issuecomment-971824612
basically: trying to use System.Text.Json 6 in a dotnetapp3.1 application (which cannot be upgraded at the moment). This causes that the source generators to break the build.
One workaround suggested was to pass DisableSystemTextJsonSourceGenerator=true
to the dotnet build
command.
I tried that in the command line as -p:DisableSystemTextJsonSourceGenerator=true
but the build still fails.
It's also mentioned is possible to pass it throuh the directory.builds.props but I don't know how to do that.
How do you pass that parameter in that file?