简体   繁体   English

如何强制 VSCode Omnisharp 不使用 MONO?

[英]How would one force VSCode Omnisharp not to use MONO?

OS: Linux Manjaro操作系统:Linux Manjaro

VSCODE: Code-oss 1.47.1-1 c# Extension: ver 1.22.1 Issue: When opening C# programs, VSCode Screams dozens of errors both in the code and some config file. VSCODE:Code-oss 1.47.1-1 c# 扩展:ver 1.22.1 问题:当打开 C# 程序时,VSCode 在代码和一些配置文件中都出现了几十个错误。 Potential cause: This only happens when I have Mono and MSBUIL-MONO installed.潜在原因:仅当我安装了 Mono 和 MSBUIL-MONO 时才会发生这种情况。 When I uninstall them, the issue seems to disappear.当我卸载它们时,问题似乎消失了。 This is further confirmed with the Omnisharp Logs. Omnisharp Logs 进一步证实了这一点。

Omnisharp log with MONO installed.安装了 MONO 的 Omnisharp 日志。

OmniSharp server started with Mono 6.8.0.
Path: /home/paul/.vscode-oss/extensions/ms-dotnettools.csharp-1.22.1/.omnisharp/1.35.3/omnisharp/OmniSharp.exe
PID: 9916

Omnisharp log without MONO installed.未安装 MONO 的 Omnisharp 日志。

OmniSharp server started.
Path: /home/paul/.vscode-oss/extensions/ms-dotnettools.csharp-1.22.1/.omnisharp/1.35.3/run
PID: 1500

This issue is resolved when I uninstall MONO but having to constantly uninstall and reinstall MONO isn't a solution, is it.当我卸载 MONO 但必须不断卸载并重新安装 MONO 不是解决方案时,此问题已解决,是吗。

Question: How would I start the Omnisharp so that it doesn't start with MONO?问题:我将如何启动 Omnisharp 使其不以 MONO 开头? Which config files would I have to edit and how?我必须编辑哪些配置文件以及如何编辑? The project I've been doing is the simple "Hello World" program that is automatically generated when making a new console application.(by typing dotnet new console in the terminal).我一直在做的项目是在制作新的控制台应用程序时自动生成的简单“Hello World”程序。(通过在终端中键入 dotnet new console)。 Any help with this would be great.对此的任何帮助都会很棒。 thanks in advance.提前致谢。

That has worked for me:这对我有用:

In VS Code, go to File > Preferences > Settings > Extensions > C# Configuration > Change "Omnisharp: Use Global Mono" (you can search for it if the menu is too long) to "Never"在 VS Code 中,go 到 File > Preferences > Settings > Extensions > C# Configuration > Change "Omnisharp: Use Global Mono" (如果菜单太长可以搜索) 到 "Never"

Looks like there was an issue with a path change in mono and they needed to patch OmniSharp to update.看起来 mono 中的路径更改存在问题,他们需要修补 OmniSharp 以进行更新。

https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.23.11 https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.23.11

The resolution is to set the plugin that requires it (VSCode) to not use the global instance and use one per project instead...解决方法是将需要它的插件(VSCode)设置为不使用全局实例,而是每个项目使用一个...

Preferences > Settings > Extensions > C# configuration > Omnisharp: Use Global Mono > Never首选项 > 设置 > 扩展 > C# 配置 > Omnisharp:使用全局 Mono > 从不

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM