Recently updated from Visual Studio 2019 to 2022 and have been getting this error on every script in every project. Beyond annoying because of how it greys out the entire function.
The functions still work but it is visually disgusting to look at.
I have tried deleting the library folder, deleting the .sln file, going to Edit<<Preferences<<ExternalTools and clicking regenerate project files with every combination of boxes checked, reinstalling visual studio, reinstalling unity, downloading every extension recommended from forums with the same issue.
Nothing.
This was never an issue until changing visual studio versions. I added the Game development with unity workload as well.
Yes I have done all the steps there and unfortunately to no avail.
Also to the post above suggesting to revert to vs2019, I could write a 20 page essay on why I would not do that due to the amount of bugs and issues that randomly appear and disappear. I switched to 2022 so that I would never have to use that god awful program again.