I got a similar error because I had project that used .NET Standard 2.0 but the .NET Core 2.1 SDK wasn't installed in VS2019.