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 Can't Find Mono Installation #5518

Closed
killbox998 opened this issue Jan 5, 2023 · 23 comments
Closed

Omnisharp Can't Find Mono Installation #5518

killbox998 opened this issue Jan 5, 2023 · 23 comments

Comments

@killbox998
Copy link

Issue Description

Omnisharp can't find the mono installation even though in is installed

Steps to Reproduce

Install mono
uncheck "Use Modern Net"
relaunch vscode

Expected Behavior

Omnisharp Launches

Actual Behavior

Omnisharp asks to install mono

Logs

OmniSharp log

OmniSharp failed to start because of missing requirements.

C# log

Environment information

Mono Version(From Command Line) Mono JIT compiler version 6.12.0.107 (tarball Wed Dec 9 21:44:58 UTC 2020) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

TLS: __thread

SIGSEGV: altstack

Notifications: epoll

Architecture: amd64

Disabled: none

Misc: softdebug

Interpreter: yes

LLVM: yes(610)

Suspend: hybrid

GC: sgen (concurrent by default)

MsBuild Info(From Command Line) Microsoft (R) Build Engine version 16.6.0 for Mono Copyright (C) Microsoft Corporation. All rights reserved.

16.6.0.60701

VSCode version: 1.74.2
C# Extension: 1.25.2

Mono Information OmniSharp using mono: 6.12.0
Dotnet Information .NET SDK (反映任何 global.json): Version: 6.0.112 Commit: d311a58ee1

运行时环境:
OS Name: fedora
OS Version: 37
OS Platform: Linux
RID: fedora.37-x64
Base Path: /usr/lib64/dotnet/sdk/6.0.112/

global.json file:
Not found

Host:
Version: 6.0.12
Architecture: x64
Commit: 02e45a41b7

.NET SDKs installed:
6.0.112 [/usr/lib64/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.12 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.12 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

Download .NET:
https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info

Visual Studio Code Extensions
Extension Author Version
cmake twxs 0.0.17
cmake-tools ms-vscode 1.12.27
cpptools ms-vscode 1.13.9
cpptools-extension-pack ms-vscode 1.3.0
cpptools-themes ms-vscode 2.0.0
csharp ms-dotnettools 1.25.2
@slacktracer
Copy link

slacktracer commented Jan 6, 2023

Did you have any luck, @killbox998?

I'm in the same boat. For almost two days now.

I tried downgrading (based on this: https://stackoverflow.com/questions/74370803/omnisharp-requires-a-complete-install-of-mono-including-msbuild) and got this:

Starting OmniSharp server at 06/01/2023, 16:08:29
    Target: /home/slacktracer/My project/My project.sln

OmniSharp server started with Mono 6.12.0.
    Path: /home/slacktracer/.vscode/extensions/ms-dotnettools.csharp-1.25.0-linux-x64/.omnisharp/1.39.0/omnisharp/OmniSharp.exe
    PID: 12431

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on fedora 37.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to /usr/lib64/dotnet/dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 0 MSBuild instance(s)
Could not locate MSBuild instance to register with OmniSharp.

UPDATE

I downgraded C# Extension to 1.24.4 and set useGlobalMono to "always".

It gave me some intellisense. Not as much I have on Windows it seems... I'm using it for Unity so I get "Input" as a suggestion, for example, now.

It is a very unsatisfactory "solution".

I'm still going check to how much intellisense it is giving. It did not suggest basic stuff like Start, Update etc.

Don't know if you want for Unity though. Perhaps you will find this option useful.

(I'm on Fedora 37 by the way.)

@rpmccarter
Copy link

Also running into the same issue, Omnisharp v1.25.2, macOS v12.4, happy to give more info if needed but assuming @killbox998 's report is sufficient

@esklarski
Copy link

esklarski commented Jan 12, 2023

I too had the same problem when upgrading from 1.25.0 this morning. Both 1.25.1 and 1.25.2 fail to find the msbuild install. I've tried specifying a path in settings but I am not sure what file/s the extension is even looking for.

I'm on Fedora 36.

@Treeways
Copy link

Treeways commented Jan 19, 2023

I'm running Fedora 37 in an FNA project. IntelliSense doesn't work at all (I can still run builds because of my tasks.json configuration). This was on an older project that I used Omnisharp on prior to using 1.25.0, on an older project that was already working. I'm being told to install the complete version of mono, despite having mono-complete installed properly on my system from here.

After downgrading to 1.23.17 (as per the Stack Overflow link above) everything is working properly again.

@GlacierFox
Copy link

Screenshot_2023-01-20_12-15-27
I'm also getting this problem using Fedora 37 @Treeway7 .

I'm also using Unity. I've downgraded to 1.25.0 and things seem to be working as far as I know. I'm pretty new to C# so I haven't actually built anything substantial to test anything.

@luisvasq
Copy link

I was having the same issue on Fedora 36, but it's now working for me on 1.25.4. 🎉 Probably resolved after #5484.

I faced another issue with "Downloading package 'OmniSharp for Linux (Mono / x64)'" hanging on startup (same as #1028). In case it is helpful, I fixed it by going to the extension's package.json file (~/.vscode/extensions/ms-dotnettools.csharp-1.25.4-linux-x64/package.json), and finding the entry in runtimeDependencies that matched my system. Then, pointed the url to one of the official releases in the omnisharp-roslyn repo.

In my case, my system's entry was https://github.com/OmniSharp/omnisharp-vscode/blob/09b09bc069e4eefea65ef6d9bb436a0809e5ded5/package.json#L297-L316 and I changed the url's value to https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.39.4/omnisharp-linux-x64.zip.

@esklarski
Copy link

Installed 1.25.4 this morning and the problem has disappeared for my system. I guess #5484 was the trouble.

@slacktracer
Copy link

slacktracer commented Jan 31, 2023

After I saw updates to this issue I went back to it hopeful but 1.25.4 did not help me. It seems I have everything in place but the issue persists...

Last metadata expiration check: 0:00:23 ago on Mon 30 Jan 2023 21:03:58 -03.
Package mono-complete-6.12.0.158-0.xamarin.1.epel8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Well, at least I did not get my hopes too high. 🤷🏼‍♀️

UPDATE: I installed msbuild, rebooted and the error/issue was gone. Not sure I have intellisense working yet tough.

There is a msbuild "inside" dotnet. You can run dotnet msbuild and see for yourself if you have dotnet installed but I did not know, still don't, if it is possible to point to this one...

@Treeways
Copy link

Treeways commented Feb 9, 2023

Omnisharp is working for me now on 1.25.4, running Mono and FNA!

@BrunoKatz
Copy link

similar issue here (Linux Mint 21 Vanessa base: Ubuntu 22.04 jammy) downgrading as mentioned in issue below seems to have helped for the moment:
#5443 (comment)

@ffxsam
Copy link

ffxsam commented Apr 3, 2023

This issue is still not fixed for macOS arm64?

@NotTimIsReal
Copy link

I also get this issue in version 1.25.4 on an intel mac, I had to downgrade back to 1.25.0

@thekoc
Copy link

thekoc commented May 29, 2023

It'll complain "Mono Installation" for the initial launch but works fine if I restart VSCode. Any ideas?

@MickaelNeves
Copy link

Same issue running v1.25.7

@nevyn
Copy link

nevyn commented Jun 4, 2023

Same issue on v1.25.8 on Ubuntu 20.04. Complains about missing mono install on every launch even though I have latest version installed.

@chrisbenincasa
Copy link

chrisbenincasa commented Jun 14, 2023

Getting this on Fedora 38 w/ version 1.25.9

EDIT: I think this is actually because it can't find msbuild. Many of the examples for a mono path show Mac OS paths. For Linux, I don't see an individual msbuild executable installed anywhere after installing mono-complete on my machine

@JoeRobich
Copy link
Member

Fedora's mono-complete package does not include msbuild unfortunately. I did find a way to install it on Fedora 36 which may still be an option, see #5232 (comment).

@chrisbenincasa
Copy link

Interestingly I got this working by aliasing dotnet msbuild to msbuild

@esklarski
Copy link

I've since upgraded through to Fedora 38 and the CentOs mono package keeps working fine.

@quadristan
Copy link

quadristan commented Jun 25, 2023

I did what @chrisbenincasa did, and the extension still cannot find mono installation ( On Fedora 38)

❯ mono --version
Mono JIT compiler version 6.12.0.182 (tarball Thu Jan 19 23:19:38 UTC 2023)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        Interpreter:   yes
        LLVM:          supported, not enabled.
        Suspend:       hybrid
        GC:            sgen (concurrent by default)

❯ msbuild --version
MSBuild version 17.4.4+8e9cb2952 for .NET
17.4.4.31401%    

❯ dnf list installed | grep mono-complete
mono-complete.x86_64  6.12.0-11.fc38                      @fedora 

The extension works fine in 1.24.0 with "omnisharp.useGlobalMono":"always"

@davl3232
Copy link

davl3232 commented Jul 8, 2023

Downgrading to 1.25.0 worked for me on an M1 mac. This video shows the whole setup that worked for me:
https://www.youtube.com/watch?v=3_OejJf_mN8

@WDeenik
Copy link

WDeenik commented Jul 26, 2023

I'm running into this issue as well on an ARM mac. After a full restart (quitting vscode in the dock) everything works like it should, but after normally closing the window and reopening it, I get this error.

For now I'm reverting back to 1.25.0 as well.

@JoeRobich
Copy link
Member

A lot has changed with O# and mono since this issue was opened. If you are still having problems, please open a new issue at https://github.com/omnisharp/omnisharp-roslyn/issues

@JoeRobich JoeRobich closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests