The type or namespace name 'System' could not be found on Visual Studio Code for Mac

6.2k Views Asked by At

After accidentally deleting a project via the Source Control area of VSCode Omnisharp stopped working altogether. Nothing works on any previous project and any newly created projects. Everything works just fine on Visual Studio so I assume the problem isn't with the .NET Core installation. I'm on a Mac.

enter image description here

    "message": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [API, API, API]"

What I've tried:

  • Reinstall .Net Core 3.1 (without uninstalling it first)
  • Completely delete VSCode (including hidden directories, caches, everything)
  • Easier solutions found around the web such as rebuild, restart omnisharp, etc.

Any help is appreciated, thanks!

1

There are 1 best solutions below

0
On

Following these steps helped me to solve the issue:

 * Go to the VSCode settings (File > Preferences > Settings).
 * Search with the keywords omnisharp use global mono to locate the configuration.
 * Change the value to never from either auto or always.
 * REMEMBER to restart the VSCode to activate the change (I restarted it twice to be sure).