I'm using Visual Studio Code and .NET Core SDK 3.1.402, and trying to learn how to code C# (so I've got the most recent version of the extension downloaded.
When I create a new project (using cmd, dotnet new console), I am immediately greeted with several errors in the "Hello World" code that it generates automatically.
One of them right at the top is: Unnecessary using directive. [GradeBook]csharp(CS8019) The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [GradeBook]csharp(CS0246)
I'm also noticing problems in the obj\debug{name}.AssemblyInfo.cs.
I've tried:
- Reinstalling Visual Studio Code
- Repairing .NET download
- Restarting Omnisharp
A basic replication here was that the first time I opened Visual Studio code after creating the project in the command prompt was that I was not greeted with errors. I saved and closed after a quick lesson, shut off and on my computer, reopened, and then the errors began showing.
I'm still able to run my code. But the red lines sure do make it hard to learn about the "real" issues.
How do I resolve something like this?
The only thing that worked for me was to completely uninstall my SDK, Visual Studio Code, and C# extension. Then reinstall them all. Once I did that, I was good to go.