Closed ArtyIF closed 2 years ago
Full framework development now requires you to set omnisharp.useModernNet
to false
in settings. Please see the announcement at https://github.com/OmniSharp/omnisharp-vscode/issues/5120.
You will also need a complete system install of Mono and MSBuild. Please try the mono-complete
package and let me know if that resolves your issue.
Full framework development now requires you to set
omnisharp.useModernNet
tofalse
in settings. Please see the announcement at #5120.You will also need a complete system install of Mono and MSBuild. Please try the
mono-complete
package and let me know if that resolves your issue.
No, it doesn't resolve the issue. The only dependencies mono-complete
package installs that I don't have is ibm-data-db2
, mono-data-oracle
, mono-reactive
and mono-locale-extras
. And yes, I have omnisharp.useModernNet
set to false
.
Thanks for checking on that package. I will not pretend I know anything about how these Fedora packages are maintained. Doing a search for a MSBuild package isn't turning up anything for Fedora (https://pkgs.org/search/?q=msbuild). I will keep investigating.
Looks like there is a closed issue for an installable Mono MSBuild package for Fedora - https://github.com/mono/linux-packaging-msbuild/issues/18. If only there were an equivalent to one of these packages - https://archlinux.pkgs.org/rolling/archlinux-community-x86_64/mono-msbuild-16.10.1.xamarinxplat.2021.05.26.14.00-2-x86_64.pkg.tar.zst.html & https://voidlinux.pkgs.org/current/voidlinux-main-x86_64/msbuild-bin-16.6_2.x86_64.xbps.html
Posting this here from #5120
As far as I can tell msbuild is installed properly on my system (Fedora 36). I have mono-develop
and mono-complete
installed.
[xxxx@fedora ~]$ dotnet msbuild -ver
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
17.0.0.26101
Not sure why Omnisharp can't find it...
I got it to work by downgrading the extension to 1.24.4, and adding the following to the settings.json:
"omnisharp.useModernNet": false,
"omnisharp.path": "",
"omnisharp.useGlobalMono": "always",
From here upgrading to 1.25.0 breaks the MSBuild connection again. Seems 1.25.0 is the problem?
@esklarski Mono does not use the dotnet SDK MSBuild. You would need to check msbuild -ver
to see if you have a proper install.
bash-3.2$ msbuild -ver
Microsoft (R) Build Engine version 16.6.0 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
16.6.0.10801
What Fedora seems to be lacking is a mono-msbuild package similar to https://archlinux.pkgs.org/rolling/archlinux-community-x86_64/mono-msbuild-16.10.1.xamarinxplat.2021.05.26.14.00-2-x86_64.pkg.tar.zst.html which installs the Mono MSBuild. According to this post (https://blog.timpack.org/fedora-29-and-mono-5) there used to be a msbuild package.
Perhaps these instructions to install the Fedora mono packages would resolve the issue https://www.mono-project.com/download/stable/#download-lin-fedora
"omnisharp.useModernNet": false, only set this one will take effect at 1.25.0, and delete others - "omnisharp.path": "",
@esklarski Mono does not use the dotnet SDK MSBuild. You would need to check
msbuild -ver
to see if you have a proper install.bash-3.2$ msbuild -ver Microsoft (R) Build Engine version 16.6.0 for Mono Copyright (C) Microsoft Corporation. All rights reserved. 16.6.0.10801
What Fedora seems to be lacking is a mono-msbuild package similar to https://archlinux.pkgs.org/rolling/archlinux-community-x86_64/mono-msbuild-16.10.1.xamarinxplat.2021.05.26.14.00-2-x86_64.pkg.tar.zst.html which installs the Mono MSBuild. According to this post (https://blog.timpack.org/fedora-29-and-mono-5) there used to be a msbuild package.
Okay, that answers that.
msbuild -ver
returns command not found...
Perhaps these instructions to install the Fedora mono packages would resolve the issue https://www.mono-project.com/download/stable/#download-lin-fedora
I tried this but there were dependancy conflicts and I know nothing about resolving those. I'll be looking into this, but I will also try talking to a Fedora person about the dotnet package.
So I don't think the mono-project thing is going to work...
Error:
Problem: conflicting requests
- package mono-complete-5.18.0.268-0.xamarin.3.epel8.x86_64 requires mono-devel = 5.18.0.268, but none of the providers can be installed
- package mono-complete-5.18.1.0-0.xamarin.1.epel8.x86_64 requires mono-devel = 5.18.1.0, but none of the providers can be installed
- package mono-complete-5.18.1.3-0.xamarin.1.epel8.x86_64 requires mono-devel = 5.18.1.3, but none of the providers can be installed
- package mono-complete-5.20.1.19-0.xamarin.3.epel8.x86_64 requires mono-devel = 5.20.1.19, but none of the providers can be installed
- package mono-complete-5.20.1.34-0.xamarin.2.epel8.x86_64 requires mono-devel = 5.20.1.34, but none of the providers can be installed
- package mono-complete-6.0.0.313-0.xamarin.7.epel8.x86_64 requires mono-devel = 6.0.0.313, but none of the providers can be installed
- package mono-complete-6.0.0.319-0.xamarin.1.epel8.x86_64 requires mono-devel = 6.0.0.319, but none of the providers can be installed
- package mono-complete-6.0.0.327-0.xamarin.1.epel8.x86_64 requires mono-devel = 6.0.0.327, but none of the providers can be installed
- package mono-complete-6.0.0.334-0.xamarin.1.epel8.x86_64 requires mono-devel = 6.0.0.334, but none of the providers can be installed
- package mono-complete-6.10.0.104-0.xamarin.17.epel8.x86_64 requires mono-devel = 6.10.0.104, but none of the providers can be installed
- package mono-complete-6.12.0.107-0.xamarin.9.epel8.x86_64 requires mono-devel = 6.12.0.107, but none of the providers can be installed
- package mono-complete-6.12.0.90-0.xamarin.3.epel8.x86_64 requires mono-devel = 6.12.0.90, but none of the providers can be installed
- package mono-complete-6.4.0.198-0.xamarin.3.epel8.x86_64 requires mono-devel = 6.4.0.198, but none of the providers can be installed
- package mono-complete-6.6.0.161-0.xamarin.6.epel8.x86_64 requires mono-devel = 6.6.0.161, but none of the providers can be installed
- package mono-complete-6.8.0.105-0.xamarin.3.epel8.x86_64 requires mono-devel = 6.8.0.105, but none of the providers can be installed
- package mono-complete-6.8.0.123-0.xamarin.2.epel8.x86_64 requires mono-devel = 6.8.0.123, but none of the providers can be installed
- package mono-complete-6.8.0.96-0.xamarin.3.epel8.x86_64 requires mono-devel = 6.8.0.96, but none of the providers can be installed
- package mono-devel-5.18.0.268-0.xamarin.3.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-5.18.1.0-0.xamarin.1.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-5.18.1.3-0.xamarin.1.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-5.20.1.19-0.xamarin.3.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-5.20.1.34-0.xamarin.2.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.0.0.313-0.xamarin.7.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.0.0.319-0.xamarin.1.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.0.0.327-0.xamarin.1.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.0.0.334-0.xamarin.1.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.10.0.104-0.xamarin.17.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.12.0.107-0.xamarin.9.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.12.0.90-0.xamarin.3.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.4.0.198-0.xamarin.3.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.6.0.161-0.xamarin.6.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.8.0.105-0.xamarin.3.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.8.0.123-0.xamarin.2.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- package mono-devel-6.8.0.96-0.xamarin.3.epel8.x86_64 requires libgdiplus-devel, but none of the providers can be installed
- nothing provides pkgconfig(glib-2.0) needed by libgdiplus-devel-5.6-0.xamarin.2.epel8.x86_64
- nothing provides pkgconfig(gmodule-2.0) needed by libgdiplus-devel-5.6-0.xamarin.2.epel8.x86_64
- nothing provides pkgconfig(gthread-2.0) needed by libgdiplus-devel-5.6-0.xamarin.2.epel8.x86_64
- nothing provides pkgconfig(glib-2.0) needed by libgdiplus-devel-5.6.1-0.xamarin.3.epel8.x86_64
- nothing provides pkgconfig(gmodule-2.0) needed by libgdiplus-devel-5.6.1-0.xamarin.3.epel8.x86_64
- nothing provides pkgconfig(gthread-2.0) needed by libgdiplus-devel-5.6.1-0.xamarin.3.epel8.x86_64
- nothing provides pkgconfig(glib-2.0) needed by libgdiplus-devel-6.0.2-0.xamarin.1.epel8.x86_64
- nothing provides pkgconfig(gmodule-2.0) needed by libgdiplus-devel-6.0.2-0.xamarin.1.epel8.x86_64
- nothing provides pkgconfig(gthread-2.0) needed by libgdiplus-devel-6.0.2-0.xamarin.1.epel8.x86_64
- nothing provides pkgconfig(glib-2.0) needed by libgdiplus-devel-6.0.4-0.xamarin.1.epel8.x86_64
- nothing provides pkgconfig(gmodule-2.0) needed by libgdiplus-devel-6.0.4-0.xamarin.1.epel8.x86_64
- nothing provides pkgconfig(gthread-2.0) needed by libgdiplus-devel-6.0.4-0.xamarin.1.epel8.x86_64
- nothing provides pkgconfig(glib-2.0) needed by libgdiplus-devel-6.0.5-0.xamarin.1.epel8.x86_64
- nothing provides pkgconfig(gmodule-2.0) needed by libgdiplus-devel-6.0.5-0.xamarin.1.epel8.x86_64
- nothing provides pkgconfig(gthread-2.0) needed by libgdiplus-devel-6.0.5-0.xamarin.1.epel8.x86_64
(try to add '--skip-broken' to skip uninstallable packages)
¯_(ツ)_/¯
Downgrading to 1.24.x or earlier works as a workaround for now, but is obviously undesired
@esklarski On a fresh Fedora 36 install I ran the following successfully.
sudo su
rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'
dnf update
dnf install mono-complete
Then checked the msbuild version
[root@fedora jrobichaud]# msbuild -ver
Microsoft (R) Build Engine version 16.6.0 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
Yeah, talking with someone on the DotNetEvolution Discord I found the same thing. On a fresh install the instructions work.
But this was easily solved. Running sudo dnf list installed | grep mono
showed that when I uninstalled the Fedora packaged mono a few packages were left. Once I uninstalled those, everything worked as expected.
So it would seem Fedora users need to ensure no mono packages are installed before proceeding with the Mono Project package install.
I'll be testing the v1.25 extension again this evening and will report back.
Okay, I can confirm everything seems to be working properly now. Thanks for the help.
Fedora users beware of orphaned mono packages ;-)
Glad things are working now. Will close this out.
This worked for me:
sudo rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo' dnf update dnf install mono-complete
These steps basically.
Although I had to dnf remove
the existing mono-core package otherwise there were problems with dnf update
.
But now I'm getting the following error. It seems that the version of mono on my fedora 35 installation does not have the required version of MSBUILD
.
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: Mono 16.6.0 - "/usr/lib/mono/msbuild/Current/bin"
[warn]: OmniSharp.CompositionHostBuilder
It looks like you have Mono installed which contains a MSBuild lower than 16.7.0 which is the minimum supported by the configured .NET Core Sdk.
Try updating Mono to the latest stable or preview version to enable better .NET Core Sdk support.
@ccaneke If your projects are not .NET SDK projects, then you can ignore that warning. Otherwise, you would want to set omnisharp.useModernNet
to true
and have a .NET 6 SDK installed.
@ccaneke @esklarski @JoeRobich After following those steps, I noticed that I only had msbuild v16.6.0
, but I need at least v17.0.0
for a vim plugin I'm using in a Unity Project. Were you ever able to find how to update to a newer version?
@BagelSeasoning234 I believe the latest MSBuild that is shipping with the release Mono is 16.10 (ultimately it depends on your distro). The .NET SDK ships with the latest 17.x MSBuild, however that may not help since last I recall Unity generates Full Framework projects not SDK projects.
@BagelSeasoning234 After doing some snooping, it appears that maybe a community member has written a plugin that will generate SDK style projects for Unity. You could then run with omnisharp.useModernNet
set to true
against a .NET 6+ SDK.
Alright, thanks! It appears as though the immediate issue I was having with the vim plugin was caused by another problem that I was able to resolve, but given that I still get warning messages about updating msbuild
, I will make sure to look into that if I have any additional issues.
Issue Description
OmniSharp has recently stopped shipping Mono with its installs. While on most Linux distros this causes no issues, on Fedora 36 this breaks non-SDK-style projects like Unity projects, since Fedora 36 does not ship Mono MSBuild anywhere in its repositories, which is required by OmniSharp for non-SDK-style projects.
Steps to Reproduce
Expected Behavior
OmniSharp boots up and works as intended.
Actual Behavior
OmniSharp boots up, but reports that no MSBuild has been found.
Logs
OmniSharp log
Environment information
VSCode version: 1.66.2 C# Extension: 1.25.0
Mono Information
OmniSharp using mono :6.12.0Dotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.105 Commit: 1c35735293 Runtime Environment: OS Name: fedora OS Version: 36 OS Platform: Linux RID: fedora.36-x64 Base Path: /usr/lib64/dotnet/sdk/6.0.105/ Host (useful for support): Version: 6.0.5 Commit: 70ae3df4a6 .NET SDKs installed: 6.0.105 [/usr/lib64/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.5 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.5 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |csharp|ms-dotnettools|1.25.0| |file-downloader|mindaro-dev|1.0.12| |gitlens|eamodio|12.0.7| |material-product-icons|PKief|1.3.0| |unity-debug|Unity|3.0.2| |vscodeintellicode|VisualStudioExptTeam|1.2.21|;