-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omnisharp Update - Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable. #4489
Comments
Same thing here; it was working fine with 1.23.9, but the 1.23.10 update is completely broken for me. I've tried setting Current workaround is to force downgrade to 1.23.9. |
very sorry to hear you ran into these issues. there is an unfortunate bug introduced in the last release, where the extension fails to start when global Mono is not installed on the machine (also present if you configured it to not use global Mono). there should be a hotfix as soon as possible, for now a workaround is to install a global Mono https://www.mono-project.com/download/preview/ then it will work fine (also with the setting edit: the PR with the fix is here #4492 |
@filipw
Here is proof dotnet is on the path with the required framework: This is my launch configuration: {
"version": "0.2.0",
"configurations": [
{
"name": "Launch and Debug Hosted Blazor WebAssembly App",
"type": "blazorwasm",
"request": "launch",
"hosted": true,
"preLaunchTask": "npm run build:debug",
"program": "${workspaceFolder}/src/Presentation/WebApp/Server/bin/Debug/net5.0/EcosystemMapGenerator.Presentation.WebApp.Server.dll",
"cwd": "${workspaceFolder}/src/Presentation/WebApp/Server"
}
]
} |
@mdmoura @krrg @niem94 We have a prerelease build with Filip's fix - https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.23.11. Will be validating and releasing this afternoon. Here are instructions for installing our prerelease builds if you would like to upgrade now - https://github.com/OmniSharp/omnisharp-vscode/wiki/Installing-Beta-Releases |
@captainsafia which repo should we move this issue to? |
You can move it to the aspnetcore repo. |
Confirmed, 1.23.11 fixes the issue. 🎉 |
I'm still seeing this with a Unity project. My environment details:
The error I see when attempting to start OmniSharp is:
I have attempted to regenerate the solution files from within Unity. I have restarted VSCode. I confirmed that my Any ideas? Is this still a bug for certain configurations? For the record, typing
The project where I'm seeing this occur is new. Older projects do not appear to suffer from this issue. |
@ericdrobinson Sorry you are runnign into issues. Not sure why mono wouldn't be on your path. I know that on Mac, the environment variables that an application can see are based on how the application was launched (from the dock, from the commandline, etc). You can set the |
@JoeRobich Thanks for the response. Some responses in-kind:
Launched from the dock. OmniSharp works fine in some pre-existing projects from that launch. The project I'm experiencing this issue with was created in the same VS Code process as the working projects. VS Code's terminal (which starts with the same environment as VS Code itself, as I understand things) is able to locate mono using
Why is this global-only (User setting versus Workspace setting)? I expect that someone may want to override the specific mono-path on a workspace-based setting if for no other reason than to test different versions or ensure that some environments are locked to a known-working version. Is there a specific reason for such a decision? In other news, using the setting suggested above does enable the problematic project to use OmniSharp. That said, I've started seeing stuff like this in the OmniSharp Log:
This now happens in both previously working and previously not working projects. Error/warning reporting looks to be unaffected, however, and features like IntelliSense do work. I include it here for completion's sake. I should also point out that this output was, to my recollection, not present in the OmniSharp log for previously working projects before changing the global mono path. No idea what's going on or if this actually even matters. |
@ericdrobinson Glad things are working a little better.
I believe the terminal simply hosts a shell which would construct its environment with additions from its config files.
Many users and projects commit workspace settings to their repo. This setting, if committed, could cause issue for other team members who use Mono and might be different platforms. That being said. We have certainly recieved feedback that our users would like more flexibility with these settings.
This seems to indicate that the PATH didn't include the dotnet installation folder either. |
@JoeRobich Thanks again for the responses:
So why, then, would previous versions of OmniSharp work without issue but suddenly break for one new project?
I guess I don't understand why these settings can't simply be available in both User and Workspace contexts? Presumably a User setting would be "global" and a "Workspace" would be local to the specific workspace (and override any global setting). This is how VSCode's own settings tend to be, right? Is there a specific reason to not provide this flexibility?
Interesting. Any advice on how to address this? |
How was the project that display's the issue opened in VS Code? VS Code's File > New Window?
Nothing other than the intial reasoning that made it a user setting.
It likely has the same root problem that is causing Mono not to be avilable from the PATH. |
Just in case anyone else gets here looking for a solution Got the same issue right now, perhaps occurred after recent MacOS update. Killed vscode, killed Unity. Restarted Unity, regenerated project files (Unity -> Preferences -> External Tools) then opened vscode from within Unity (dbclick on any script). Took about a minute for intellisense to kick off but it did eventually. Hope it helps |
@JoeRobich Some responses:
Select "Open C# Project" from the "Assets" menu in Unity. To be fair, I did not actually try opening the project by creating a New Window and then use "Open Recent" to see if that changed anything. My assumption going into this was that the PATH was configured at application launch and all windows would share that setup, regardless of how new projects were opened. Is that not the case?
Sure. Is that something that can be configured in settings somewhere? Also, what exactly is not working when that failure occurs? |
1.56.x is just broken for Unity. multiple things don't load, git not seeing the repo and telling me there is no repo and to initialize one, OmniSharp can't find mono - Nothing above was helpful, Reverted to 1.55.2 (https://code.visualstudio.com/updates/v1_55) - No issues, everything works as expected. |
@qcha0s Is this something that should be reported to the VSCode issues, then? Or did you attempt to do anything about getting a specific earlier version of OmniSharp before changing your VSCode version? I imagine that the git issues you described had very little if anything to do with the OmniSharp extension... |
Worked for me 🙌 |
Me either, thx~ Totally save my day : ) |
+1 worked for me |
+1 worked for me too |
+1, thank you! |
Regenerating my project files did nothing. Terminal can find mono: % which mono
/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono I tried setting I do also have This is with version 1.23.13 of the C# extension. I have no intellisense or anything useful from the C# extension except maybe a few snippets (and some really annoying behavior on spacebar that I had to disable using autosuggest on commit character over). Edit: following directions from the vscode unity doc I downloaded and installed the latest version of mono and then restarted my laptop. It seems to be working now. I did not install the Visual Studio Code editor package for Unity. it hasn't been updated in about 2 years and the features the page says are missing (generating csproj and sln files, and opening scripts from unity) are present and working in the 2020 lts version of Unity that I have this project in. |
this solution worked for me |
After Adding "omnisharp.useGlobalMono" to "Always" and then following the steps above got it working in no time. It was hitting regenerate project files for me. Using VS code and unity on Mac! Thanks for this thread everyone! |
Mine's not working. What did you guys do other than:
I've done these, yet bear no result. VSCode 1.60.2 |
@sawirricardo I had the same issue on my macbook, but rebooting made it work for me. Did you get it working? |
Rebooting works. Until I have to shut down my vscode. And secondtime I open again, the problem reappears again. I made it work again by restarting Unity, though. |
thank you! |
@JoeRobich Just so you know this fix is incomplete. It works after a reboot or after force quitting vscode, but doesn't work after closing and reopening vscode normally (on my mac)
|
I have resolved this problem due to installing Mono and mono-msbuild and my computer is Arch. |
The original issue might have been fixed but I am seeing the same error while trying to open both C# projects from two different Unity instances. One project will open fine but Intellisense will not start in the second project and the OmniSharp log shows the same 'Unable to find Mono' error. I am currently running macOS 11.6, VSCode 1.64.2, OmniSharp 1.24.0, Mono 6.12.0.162 (but it's been happening for a looong time). Using @JoeRobich's suggestion above, I edited the settings.json to include a manual path |
It worked the first time then the problem returned!! |
edit worked for me ! |
|
[ERROR] Error: spawn mono ENOENT
Drops an error for me |
Issue Description
Visual Studio Code just automatically updated Omnisharp and now I get the error:
Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable.
A few hours ago it was working without any problem ...
Logs
OmniSharp log
[ERROR] Error: Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable.
Environment information
VSCode version: 1.55.1
C# Extension: 1.23.10
Mono Information
There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable.Dotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.102 Commit: 71365b4d42Runtime Environment:
OS Name: Mac OS X
OS Version: 11.0
OS Platform: Darwin
RID: osx.11.0-x64
Base Path: /usr/local/share/dotnet/sdk/5.0.102/
Host (useful for support):
Version: 5.0.2
Commit: cb5f173b96
.NET SDKs installed:
3.1.405 [/usr/local/share/dotnet/sdk]
5.0.102 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: