What is the correct way to update System.Text.Encodings.Web across my entire VS 2019 solution?

Viewed 3134

I see here that it's recommended that I just get the most recent version of the SDK installed, after which all should be well. I installed the most recent version of the 3.1 SDK, though, and am still seeing references to the dangerous version (4.5.0) in most if not all of my solution's two dozen or so project.assets.json files. For example,

 "Microsoft.AspNetCore.Http.Abstractions/2.2.0": {
    "type": "package",
    "dependencies": {
      "Microsoft.AspNetCore.Http.Features": "2.2.0",
      "System.Text.Encodings.Web": "4.5.0"
    },

I'm running VS Version 16.9.4.

Does anyone have a suggestion for the best way to update this assembly throughout my solution?

1 Answers

First,run a clean between your builds last time, if it still does not work, please try explicitly specifying 5.0.1 as well as 4.5.1 versions for System.Text.Encoding.Web.

<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1" />

Run dotnet list package --include-transitive in the terminal (workdir: project), it will provide you some details what version is used.You can check it.

Related