I created a .core console application and without adding any nuget packages or even one line of code, I did a build on it and got two errors (Visual Studio 19 16.8)
Error NETSDK1060 Error reading assets file: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. ABC C:\Program Files\dotnet\sdk\5.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets
the lines in question in the Microsoft.PackageDependencyResolution.targets:
ProjectAssetsFile="$(ProjectAssetsFile)"
After fighting this for hours, I went ahead and uninstalled Visual Studio 2019 and even used InstallCleanup.exe in hopes of scrubbing any settings I may have messed up.
After reinstalling Visual Studio clean, I created a .Core console application and built it -- same error.
What is going on? With this line I am assumming that its in my projects project.assets.json file ... but I have nothing about Newtonsoft.Json, Version=9.0.0.0 '''$(MSBuildProjectExtensionsPath)/project.assets.json'''
It is obviously loading some deeply rooted and hidden project.assets.json file but how do I find where this is? I have been on this issue for over 9 hours.
Any help would be appreciated.
Thank you.
EDITS: This is only happening with a . Core console application. a standard .Net framework console application has no problems.
Also, if I add a random nuget package, the top level package under dependecies has a yellow asterick, although the .dll under that is pointing at a valid DLL