Hi All,
This is INFORMATION - Not request for help
You may experience issue with VS Code not recognizing C# code targeted for .NET Core 3.0 if you also have SnapDevelop installed. Same issue may occur if you have any app installed that embeds MSBuild. Same issue reported by developers running Win10, Linux, or Mac.
This issue occurs often but not always.
STEPS TO REPRODUCE
- Ensure your VS Code has installed C# Extensions most recent version
- Install .NET Core 3.0 SDK
- Create simplest possible .NET app using command
dotnet new console MyDemo
- Open VS Code to look at code in MyDemo folder
EXPERIENCED BAD BEHAVIOR
- VS Code's C# extensions can't recognize System, System.Void, System.Object, System.String, etc.
- Occurs for TargetFramework = netcoreapp3.0. in your
.csproj
file - No issue for TargetFramework = netcoreapp2.*
- VS Code asks you to restore to fix issue but problem persists after restore.
RESOLUTIONS
Three different remedies seems to work:
- Close VS Code; install Visual Studio 2019; reopen VS Code.
- Close VS Code; Uninstall .NET Core 2.2 SDK; reopen VS Code; and "restore" packages
- (Reduced disk footprint of VS 2019)
Close VS Code; install Build Tools for Visual Studio 2019 including [Individual components] => [.NET Core 3.0 SDK]; reopen VS Code.
CONCLUSION
This is NOT a problem in SnapDevelop. It is an inherent issue in C# Extensions for VS Code. Still, you should know how to resolve it in case it ever happens on your machine too.
HTH /Michael