Cannot start OmniSharp because Mono version >=6.4.0 is required
Answer a question I use VSCode for Unity development. Unfortunately, I'm not getting any IntelliSense within VSCode for my C# code. The root cause appears to be OmniSharp failing to find Mono, as the
Answer a question
I use VSCode for Unity development. Unfortunately, I'm not getting any IntelliSense within VSCode for my C# code. The root cause appears to be OmniSharp failing to find Mono, as the OmniSharp Logs within VSCode read: "[ERROR] Error: Cannot start OmniSharp because Mono version >=6.4.0 is required."
This is an issue I've run into multiple times. On 3/4/2021 and for months prior everything was working just fine and IntelliSense was working perfectly for multiple Unity projects and multiple Unity versions. Then the next day it broke for some unknown reason and didn't work for any project, until late at night after trying a bunch of things I was able to get it working. And now this morning I'm once again getting this error. Each time between it working and it breaking I didn't make any changes besides restarting my computer.
- MacOS Mojave 10.14.6
- Unity 2020.2.0f1 + Visual Studio Code Editor 1.2.3 package for Unity
- VSCode 1.54.1 + C# 1.23.0 plugin for VSCode
- Mono 6.12.0.122 installed at
/usr/local/bin/mono
viabrew
- Mono 6.12.0 also installed manually at
/Library/Frameworks/Mono.framework/Versions/Current/Commands/
which mono
in my terminal and VSCode's terminal outputs/usr/local/bin/mono
mono --version
in both terminals outputsMono JIT compiler version 6.12.0.122
echo $PATH
contains paths to both versions of Mono,/usr/local/bin/mono
appearing firstmsbuild
outputsMicrosoft (R) Build Engine version 16.6.0 for Mono
andwhich msbuild
outputs/usr/local/bin/msbuild
dotnet --info
outputs.NET Core SDK
Version: 3.1.201
In my VSCode's settings I've set the following:
"omnisharp.loggingLevel": "debug",
"omnisharp.monoPath": "/usr/local/bin/mono",
"omnisharp.useGlobalMono": "always"
Things I've tried:
- Downgrading/upgrading VSCode's C# plugin (including to the latest version of 1.23.9)
- Downgrading Unity's Visual Studio Code Editor package
- Switching VSCode to use the version of Mono 6.12.0 I manually installed at
/Library/Frameworks/Mono.framework/Versions/Current/Commands/
(and uninstalling thebrew
-installed version) - Unsetting the
omnisharp
settings in VSCode (it leads to a different error about .NET SDKs) - Deleting Unity's
.csproj
and.sln
files so that it can regenerate them - Manually telling Unity to regenerate all the
.csproj
files - Restarting
- Looking at many forums posts and Stack Overflow questions on the topic for solutions
So does anyone have any suggestions for getting IntelliSense working in VSCode? Any tips for debugging why OmniSharp can't find Mono? I feel like I've done everything in my power to point OmniSharp to the correct place, I wish it logged a bit more about what it was trying.
Answers
I was able to resolve the issue by downgrading Visual Studio Code to 1.52.1 at https://code.visualstudio.com/updates/v1_52 and turning off automatic updates in VS Code. OmniSharp is now working without any exceptions. Seems likely that the root cause lies with VS Code 1.54 (or possibly 1.53)
更多推荐
所有评论(0)