I used command dotnet new console -n Test to create it, and and build it just fine by running command dotnet run and dotnet build.
But I get the error in the IDE, how do I fix that?
If I try do add a using System; on top it even errors on that:
Seems a bit strange as this would be the first line of a non minimal project (and unnecessary to shows something is wrong in the IDE).
CodePudding user response:
With C#10 there has been introduced global using directives. It might not yet be supported by Visual Studio Code, as C# support comes with an extension that last has been updated in August 21', so before release of .Net 6 and C#10. See changelog of C# extension for VS code
In the future you should see the changelog updated with C#10 support. For now you can use Rider and Visual Studio for example, as those IDEs support new featues.
Of course you can also create an application in older version of .net and continue using VS Code.


