vscode can't find c# namespace pieces in separate files (compiles fine)

1.8k Views Asked by At

I have written quite a bit of C# code in Visual Studio but this is my first attempt at using vscode to write a Net Core app. I am using the sample code here and it builds and runs just fine, though vscode shows the red error lines under the internal class TelePrompterConfig defined in a separate file (config.cs).

What do I need to do to clear the error in vscode? See the image below for the details. Again, this is a vscode error, not a C# error.here

Edit: added #omnisharp tag.

1

There are 1 best solutions below

1
On BEST ANSWER

I occasionally sporadically get the same issue when using VS Code. Probably due to some issue with the background work that Omnisharp uses to power the intellisense becoming stale.

Restarting VS Code usually solves this. Does this issue persist after restarting?