In my case, the newtonsoft.json was part of nuget package., but it was in net6.0 folder instead of net8.0 folder for this file:
C:\Users<username>.nuget\packages\newtonsoft.json\12.0.3\lib.. ..\Newtonsoft.Json.dll