Issue Type: Bug
After the latest update of Visual Studio Code (1.48.0) in linux, my codes under the C# extension show all kinds of error on namespaces in the VSCode IDE, even though all the codes can be compiled and built with dotnet cli successfully without any error or warning.
The errors include:
Extension version: 1.23.0
VS Code version: Code 1.48.0 (db40434f562994116e5b21c24015a2e40b2504e6, 2020-08-13T07:40:55.768Z)
OS version: Linux x64 5.7.0-kali1-amd64
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 3900)|
|GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: unavailable_off
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled|
|Load (avg)|1, 1, 1|
|Memory (System)|15.41GB (7.67GB free)|
|Process Argv|--no-sandbox --unity-launch|
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|lightdm-xsession|
|XDG_CURRENT_DESKTOP|XFCE|
|XDG_SESSION_DESKTOP|lightdm-xsession|
|XDG_SESSION_TYPE|x11|
I have exactly the same issue. I'm glad I'm not the only one. Sorry though...
I'm using a MacBook Pro 2017 running Catalina 10.15.6 with VSCode and the Microsoft C# extension which uses Omnisharp (which is where the bug appears to be coming from).
I have error messages like this The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [csharpdebug081620] as well as the message that the previous poster mentioned 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' but the code seems to run fine.
I have opened up several projects all with the same errors that ran perfectly. I even started a new mvc project from scratch and the errors still persisted.
Dang I've been losing my mind over this issue all morning. Glad I'm not alone.
Running a laptop with Ubuntu 20.04 (Latest VSCode and Omnisharp)
Re-installed multiple times and still getting the same errors, but the code executes perfectly fine with no errors. Seems like the editor is just not working properly.
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
is what shows up under "problems" at the bottom.
@JimBeam2019 Did you try setting omnisharp.useGlobalMono = never in VSCode settings?
If your SDK got upgraded to .NET Core 3.1.401 like mine did over the weekend, you will need to make that change in your settings otherwise everything will break. This is noted in the latest release. https://github.com/OmniSharp/omnisharp-vscode#note-about-using-net-core-31401-or-net-5-preview-8-sdks-on-mono-platforms
I was pull my hair out for hours because of this as well. Hope this will help.
@alaconda Thank you very much for your advice, and YES, IT DOES WORK. You're a lifesaver. Yeah, I didn't read through the release note carefully.
For anyone who is still struggling in this issue, here is a more detailed instruction.
Hope it could save the time of others.
AMAZING IT WORKS NOW! You guys are awesome thanks!
@JimBeam2019 you absolute legend! Fixed all the issues for me thank you!
Most helpful comment
@alaconda Thank you very much for your advice, and YES, IT DOES WORK. You're a lifesaver. Yeah, I didn't read through the release note carefully.
For anyone who is still struggling in this issue, here is a more detailed instruction.
Hope it could save the time of others.