简体   繁体   中英

How would one force VSCode Omnisharp not to use MONO?

OS: 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. Potential cause: This only happens when I have Mono and MSBUIL-MONO installed. When I uninstall them, the issue seems to disappear. This is further confirmed with the Omnisharp Logs.

Omnisharp log with MONO installed.

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.

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.

Question: How would I start the Omnisharp so that it doesn't start with 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). 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"

Looks like there was an issue with a path change in mono and they needed to patch OmniSharp to update.

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...

Preferences > Settings > Extensions > C# configuration > Omnisharp: Use Global Mono > Never

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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