Skip to content
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's mono tries to use system mono lib instead of bundled mono #1693

Closed
benknoble opened this issue Jan 31, 2020 · 20 comments · Fixed by #1697
Closed

Omnisharp's mono tries to use system mono lib instead of bundled mono #1693

benknoble opened this issue Jan 31, 2020 · 20 comments · Fixed by #1697

Comments

@benknoble
Copy link

I get this output when OmniSharp tries to start up in vim:

channel 0 open: 'dyld: Library not loaded: /Library/Frameworks/Mono.framework/Versions/6.6.0/lib/libintl.8.dylib'
channel 0 open: '  Referenced from: /Users/Knoble/.cache/omnisharp-vim/omnisharp-roslyn/bin/mono'
channel 0 open: '  Reason: image not found'
channel 0 open: '/Users/Knoble/.cache/omnisharp-vim/omnisharp-roslyn/run : ligne 28 : 54423 Abort trap: 6           "${mono_cmd}" "${omnisharp_cmd}" "$@"'

I can confirm that running the run script and the bin/mono fail, so this may be more for OmniSharp/omnisharp-roslyn.

I have an (old?) mono install floating around:

+λ ls /Library/Frameworks/Mono.framework/Versions/5.4.1/                              
Commands/   bin/        etc/        lib/        share/                                
VERSION     docs/       include/    man/        updateinfo

Regardless, I'm not sure why this mono is searching /Library/Frameworks if it was supposed to be fully bundled?

After installing an up-to-date mono with brew, the bundled mono still looks in /Library/Frameworks where the new version is not.

(From OmniSharp/omnisharp-vim#556.)

@filipw
Copy link
Member

filipw commented Jan 31, 2020

the minimum required Mono version is 6.6.0.
OmniSharp looks at global mono if you have it installed on your machine because it would prefer to use that msbuild instead of the bundled one.

@benknoble
Copy link
Author

Right, but I definitely don't have mono 6.6.0 (or, I didn't...). Surely this should be easily detectable, and omnisharp could use the bundled mono?

@DwaynesWorld
Copy link

Yea, I am running in to the same issue. It happens when I am running version 1.21.10 of the C# extension in vscode (ms-vscode.csharp). If I downgrade everything seems to be fine.

@filipw
Copy link
Member

filipw commented Feb 4, 2020

@JoeRobich isn't there something missing in the bundle here? https://github.com/OmniSharp/omnisharp-roslyn/pull/1679/files

libintl.8.dylib?

@traegerp
Copy link

traegerp commented Feb 4, 2020

I am having the same issue as @DwaynesWorld with vs code:

dyld: Library not loaded: /Library/Frameworks/Mono.framework/Versions/6.6.0/lib/libintl.8.dylib

@enigmaturing
Copy link

I am running into the same issue. I downgraded to 1.21.9 by the moment. Is there any update on this?

@filipw
Copy link
Member

filipw commented Feb 4, 2020

as discussed elsewhere, this is caused by a mono bug.

the simplest workaround for now is to install mono 6.6.0 so that the path can be found.

@gsscoder
Copy link

gsscoder commented Feb 4, 2020

@filipw,
I've exactly the same issue on a macOS machine. But the problem appeared in somewhat mysterious way.

I don't know what changed in my system and why. But obviusoly something should be happened!

Hope I can fix installing latest mono with brew.

@enigmaturing
Copy link

aa discussed elsewhere, this is caused by a mono bug.

the simplest workaround for now is to install mono 6.6.0 so that the path can be found.

Thanks @filipw :)

@gsscoder
Copy link

gsscoder commented Feb 4, 2020

@enigmaturing , I used hope because I was not sure to have success with this.

In part I was right. I've in this moment installed mono with brew. Problem disappeared, but in all my test projects OmniSharp doesn't resolve any symbol (even System.Object).

No dotnet restore worked.

I'll file an issue if I can't solve.

@enigmaturing
Copy link

@enigmaturing , I used hope because I was not sure to have success with this.

In part I was right. I've in this moment installed mono with brew. Problem disappeared, but in all my test projects OmniSharp doesn't resolve any symbol (even System.Object).

No dotnet restore worked.

I'll file an issue if I can't solve.

@gsscoder I guess you can also downgrade to 1.21.9 by the moment, until you find a solution for that

@filipw
Copy link
Member

filipw commented Feb 4, 2020

I've exactly the same issue on a macOS machine. But the problem appeared in somewhat mysterious way.

I don't know what changed in my system and why. But obviusoly something should be happened!

VS Code updates extensions automatically and this behavior is specific to C# extension 1.21.10. So it must have updated for you.

@gsscoder
Copy link

gsscoder commented Feb 4, 2020

@filipw, same think I've then thought...

I didn't solved what happens with symbols, sorry I've to bother you with an new isuee...

@ikeliec
Copy link

ikeliec commented Feb 6, 2020

I've exactly the same issue on a macOS machine. But the problem appeared in somewhat mysterious way.
I don't know what changed in my system and why. But obviusoly something should be happened!

VS Code updates extensions automatically and this behavior is specific to C# extension 1.21.10. So it must have updated for you.

That was actually what happened to me. I fixed it by downgrading to 1.21.9

@TheBuzzSaw
Copy link

I had the issue on 1.21.10 on macOS. I fixed it by running brew install mono.

@baughmann
Copy link

What's the timeline on the fix for this? It has to do with the 1.21.10 update on my system.

@filipw
Copy link
Member

filipw commented Feb 6, 2020

this is resolved in 1.21.11 in prerelease https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.21.11

@WellspringCS
Copy link

WellspringCS commented Feb 14, 2020

the minimum required Mono version is 6.6.0.
OmniSharp looks at global mono if you have it installed on your machine because it would prefer to use that msbuild instead of the bundled one.

TL;DR: How should I read the above statement?

Longer version:
I'm hunting down why omnisharp isn't formatting my cs code in VSC, noticed I was getting this error:
[ERROR] Error: command 'dotnet.test.run' already exists
and found this link
That set me on a journey of discovery regarding mono -- since updating it was noted as a "good thing" for resolving the error.

And here I am.

Noob question: is it "good" (from a VSC perspective) to install mono on Ubuntu separately? Or "bad"... What I ended up doing was installing dotnet 3.1.101 to see what that would accomplish. Now my error message is gone. But I'm wondering if I should still install mono on my own.

And... yeah, my cs files still don't format. I don't know what I'm doing wrong there (or what's wrong on my machine) but that story for another day.

@filipw
Copy link
Member

filipw commented Feb 14, 2020

TL;DR: How should I read the above statement?

if you have global Mono 6.6.0+, OmniSharp will use it and should give you better support when working with non-.NET Core projects.
if you don't have it, OmniSharp runs on its own bundled runtime (which also happens to be Mono 6.6.0-derived)

[ERROR] Error: command 'dotnet.test.run' already exists

this error is not related to the issue you are writing in 😀 normally when this happens, please grab the OmniSharp log (view -> output -> select omnisharp) and also any errors from VS Code window log (Help -> Toggle Dev Tools). Normally this error is related to conflict with other extension or unsuccessful start/restart.

And... yeah, my cs files still don't format.

if that's the case please open a new issue here https://github.com/OmniSharp/omnisharp-vscode and fill in the details of the issue template too (repro steps, Omnisharp log, list of extensions you have installed and so on), and hopefully we can help

@WellspringCS
Copy link

this error is not related to the issue you are writing in

Correct. Apologies, it was a (probably unneeded) explanation of how I got to this issue.

if that's the case please open a new issue

Actually, I did. And as I was logging it up, the issue went away. I swear there are Heisenbug issues where Omnisharp is concerned. But if I say more here, I'll just clutter this thread even more. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants