question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OmniSharp regularly "loses" Mono path, only solvable by restart of both VS Code and Unity

See original GitHub issue

Issue Description

OmniSharp regularly “loses” Mono path, only solvable by restart of both VS Code and Unity. The error message is: [ERROR] Error: Unable to find Mono. Update the "omnisharp.monoPath" setting to point to the folder containing Mono's '/bin' folder., but the monoPath is correctly set and mono can be found on that location.

Steps to Reproduce

I cannot reproduce it exactly. It typically appears once every few days during daily usage. I know that VS Code may get different environment depending on where it was launched from, but I would say typically this appears after coming back from Standby or after restarting Unity (VS Code is rarely restarted, it’s far more stable than Unity 😃 ).

Expected Behavior

That it would always find the mono executable.

Actual Behavior

Logs

OmniSharp log

Starting OmniSharp server at 6/8/2022, 9:33:36 AM Target: /Users/martin/dev/src/fictive/fictive-unity-new/fictive-unity-new.sln

[ERROR] Error: Unable to find Mono. Update the “omnisharp.monoPath” setting to point to the folder containing Mono’s ‘/bin’ folder.

C# log

(empty)

Environment information

Current monopath setting: "omnisharp.monoPath": "/Library/Frameworks/Mono.framework/Versions/Current/bin/"

PATH as seen from VS Code terminal: PATH=/Users/martin/.pyenv/shims:/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/Library/Frameworks/Mono.framework/Versions/Current/bin:/Users/martin/Library/Android/sdk/emulator:/Users/martin/Library/Android/sdk/tools:/Users/martin/Library/Android/sdk/platform-tools:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands

VSCode version: 1.67.2 C# Extension: 1.25.0

Mono Information There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Update the "omnisharp.monoPath" setting to point to the folder containing Mono's '/bin' folder.
Dotnet Information A valid dotnet installation could not be found.
Visual Studio Code Extensions
Extension Author Version
autodocstring njpwerner 0.6.1
AWK luggage66 0.0.2
better-toml bungcip 0.3.2
csharp ms-dotnettools 1.25.0
foam-vscode foam 0.18.4
gitlens eamodio 12.0.7
hexeditor ms-vscode 1.9.6
jinjahtml samuelcolvin 0.17.0
jupyter ms-toolsai 2022.4.1021342353
jupyter-keymap ms-toolsai 1.0.0
jupyter-renderers ms-toolsai 1.0.8
live-server ms-vscode 0.2.12
markdown-all-in-one yzhang 3.4.3
markdown-link-expander skn0tt 0.2.1
markdown-links tchayen 0.8.0
nodejs-repl lostfields 0.5.15
php-debug xdebug 1.26.1
php-intellisense felixfbecker 2.3.14
prettier-vscode esbenp 9.5.0
python ms-python 2022.6.3
rainbow-csv mechatroner 2.4.0
rewrap stkb 1.16.3
shellcheck timonwong 0.19.4
test-adapter-converter ms-vscode 0.1.6
theme-bright-day Squarelogic 0.1.7
theme-gray-matter philipbe 1.7.0
unity-debug deitry 3.0.11
view-in-browser qinjia 0.0.5
vscode-counter uctakeoff 3.0.5
vscode-coverage-gutters ryanluker 2.10.1
vscode-docker ms-azuretools 1.22.0
vscode-edit-csv janisdd 0.6.10
vscode-eslint dbaeumer 2.2.2
vscode-front-matter eliostruyf 7.3.2
vscode-gutter-preview kisstkondoros 0.30.0
vscode-markdown-notes kortina 0.0.24
vscode-mocha-test-adapter hbenl 2.13.5
vscode-nginx-conf-hint hangxingliu 0.3.0
vscode-pull-request-github GitHub 0.42.0
vscode-pylance ms-python 2022.6.0
vscode-styled-components jpoissonnier 1.7.0
vscode-svgviewer cssho 2.0.0
vscode-test-explorer hbenl 2.21.1

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
jjmonteslcommented, Nov 11, 2022

Today I had to revert to 1.25.1 as 1.25.2 failed to detect requirements, suggesting me to download mono (Ubuntu 20.04, with useModernNet=false).

0reactions
greghardingcommented, Nov 10, 2022

On Mac, I just updated from Omnisharp 1.25.0 to 1.25.1 and as usual Omnisharp completely falls over after an update. Usually it’s a matter of updating a few paths or restarting, but this time it’s suggesting a total reinstallation of Mono in a modal popup. I already have the latest Mono installed and have been juggling the extension settings for useModernNet, Mono Path and other settings for the last few years of versions to keep VS Code + Omnisharp working happily with Unity projects.

I haven’t figured out how to make 1.25.1 work so rolling back to 1.25.0 and waiting for it all to blow over again.

Update: And very handily today 1.25.2 is out which fixes everything up again. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved] Problems with OmniSharp and Visual Studio Code
SOLVED : Fixed the problem by reinstalling VS Code and the C# extension. I've used Visual Studio Code for few days now to...
Read more >
OmniSharp.MSBuild.ProjectManager Attempted to update ...
I've had both VSCode and Visual Studio installed on my mac. Uninstalling Visual Studio with this official guide solved the issue.
Read more >
What's new in Unity 2020.1.0 Beta 5
Editor: OmniSharp project reference warnings are thrown in VSCode console when using VSCode. Fixed in 2020.1.0b6.
Read more >
Getting Started With Unity and Virtual Reality | Jeff Rafter
Best practices for setting up your environment and building a game have changed frequently enough that it can be hard to find current...
Read more >
Intelisense problem - Ask - GameDev.tv Community
NET SDK? The Extensions I have installed in VS Code are as below (C# and Unity Code Snippets) ... I cannot find an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found