I had a similar experience, but with Enterprise.
The error persisted until I disabled Lightweight Solution Loading, but I'm including the other steps I took in case they were pre-requisites.
- I had installed the Azure Functions Support, which wanted me to restart Visual Studio, but I didn't do that until after I started getting the build error message.
- I re-ran Visual Studio installer and clicked "Modify", even though I didn't change any options, because it wanted to do something, saying my installation size would decrease by 15MB. (Some cleanup from the Azure Functions installation is my guess.)
- I disabled the Lightweight Solution Load, closes and re-opened the solution, and it finally tried to build. It failed and I got a lot of messages about running NuGet Restore and Build in parallel, but it ran. Once I did a manual NuGet Restore, the build worked.
I hope this helps.