AvaloniaUI/AvaloniaVS

[Deps] Upgrade dependency `System.Text.Json` to v4.7.0, the lowest version supported by VS2019/MSBuild

BinToss opened this issue · 2 comments

Describe the bug

VS2019/MSBuild 16.7.0 was the first in the v16.x line to depend on System.Text.Json, requiring v4.7.0. The current version of VS2019/MSBuild, 16.11, still depends on System.Text.Json 4.7.0.
See https://www.nuget.org/packages/Microsoft.Build/16.7.0

VS/MSBuild version System.Text.Json requirement
16.7.0 4.7.0
16.11.0 4.7.0
17.0.0 5.0.2
17.8.3 7.0.3

This took a few hours of sleuthing before learning MSBuild.exe's deps correlate to the Microsoft.Build.Runtime package.

To Reproduce

placeholder

AvaloniaVS plugin version

master branch

Avalonia version

No response

Visual Studio version

16.11, but applicable since 16.7

Relevant log output

placeholder

Additional context

No response

What’s the issue there? It shouldn’t be a problem for the framework runtime to pick up 4.7.0 version used by the IDE, since our plugin uses older version (and not a newer, which would be a problem).

On the other hand, we are going to drop 2019 support soon. So that one less problem either way.

I really wish I left notes for myself about why the minimum version should be bumped.
Maybe it was one of the version mismatch warnings in the build log.
Maybe it was just so the extension targets a package version used by Visual Studio rather than an older version never used by Visual Studio.
Or perhaps I got my wires crossed. I sometimes forget NuGet dependency resolution prefers "nearest, newest-patch, share deps" and I'll instead think it acts more like NPM or Yarn.