Sometimes C# for Visual Studio Code (powered by OmniSharp) becomes confused.
Try restarting OmniSharp. Here are two ways:
- Close and re-open Visual Studio Code, or
- Open the Command Pallet and type
Restart Omnisharp.
OmniSharp tends to become confused if we restore dependencies from the command line instead of from within Visual Studio Code.