c# - 在 Visual Studio Code for Mac 上找不到类型或命名空间名称“系统”
问题描述
在通过 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]"
我试过的:
- 重新安装 .Net Core 3.1(无需先卸载)
- 彻底删除 VSCode(包括隐藏目录、缓存、一切)
- 在网络上找到更简单的解决方案,例如重建、重启omnisharp等。
任何帮助表示赞赏,谢谢!
解决方案
遵循这些步骤帮助我解决了这个问题:
* 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).
推荐阅读
- android - 在约束输出中设置高度以匹配约束正在缩小视图的高度
- php - 即使对于已登录的用户,也可以在页面加载时清除 Woocommerce 购物车
- python - 移位对数图python
- mysql - 在 windows 命令中将 mysql 表导入和导出到 xml 文件?
- java - Java 8 中的比较器接口如何成为@FunctionalInterface
- php - 包含 PHP 文件时遇到问题
- bash - 无法在 bash 脚本中循环运行“gradle”相关命令
- react-native - 如何通过 react-native 中的 Youtube API 检索 Youtube 频道视频列表
- java - 如果请求参数超过 15,我应该使用 POST 或 GET 什么?
- javascript - 如何存储自定义 css 。laravel 中的 js 文件并在视图中调用它