在 Visual Studio Code for Mac 上找不到类型或命名空间名称“System”

Pab*_*uza 2 .net c# omnisharp .net-core visual-studio-code

通过 VSCode 的源控制区域意外删除项目后,Omnisharp 完全停止工作。任何以前的项目和任何新创建的项目都不起作用。在 Visual Studio 上一切正常,所以我认为问题不在于 .NET Core 安装。我在 Mac 上。

在此处输入图片说明

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

Run Code Online (Sandbox Code Playgroud)

我试过的:

  • 重新安装 .Net Core 3.1(无需先卸载)
  • 彻底删除VSCode(包括隐藏目录,缓存,一切)
  • 在网络上找到更简单的解决方案,例如重建、重启 omnisharp 等。

任何帮助表示赞赏,谢谢!

Aki*_*kif 5

按照这些步骤帮助我解决了这个问题:

 * 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).
Run Code Online (Sandbox Code Playgroud)