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-osx.zip package should use a more recent version of mono #2093

Closed
svermeulen opened this issue Feb 16, 2021 · 6 comments
Closed

omnisharp-osx.zip package should use a more recent version of mono #2093

svermeulen opened this issue Feb 16, 2021 · 6 comments

Comments

@svermeulen
Copy link

At least for me, on macOS Catalina 10.15.7, the current distributed release zip omnisharp-osx.zip fails to work for many solution types (eg. Unity-generated ones) due to the following error:

OmniSharp.MSBuild.ProjectLoader: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

Upon googling this problem I found the fix was to use a more recent version of mono. I then tried changing the run script distributed inside omnisharp-osx.zip to use my system mono (which is version 6.12.0.107) and this resolved the problem for me. So I think it would help others to update the pre-packaged mono version

@filipw
Copy link
Member

filipw commented Feb 16, 2021

This is not a problem of having an outdated version. OmniSharp's embedded Mono is also 6.12, however it doesn't ship with reference assemblies for Desktop .NET because we omit them intentionally.

The solution is to have a global Mono installed on your machine and configure the editor to launch OmniSharp with global Mono e.g. by using "omnisharp.useGlobalMono": "always" setting when you use VS Code.

I wonder why you use see such error, because in the latest release it was changed to be more helpful:

This project targets .NET version that requires reference assemblies that do not ship with OmniSharp out of the box (e.g. .NET Framework). The most common solution is to make sure Mono is installed on your machine (https://mono-project.com/download/) and that OmniSharp is started with that Mono installation (e.g. 'omnisharp.useGlobalMono':'always' in C# Extension for VS Code).

#2069

@filipw filipw closed this as completed Feb 16, 2021
@filipw
Copy link
Member

filipw commented Feb 16, 2021

wonder why you use see such error, because in the latest release it was changed to be more helpful:

ah I see now, we didn't ship this yet, it will be included in the next release

@svermeulen
Copy link
Author

Ok great. How do I set this value when not using vs code? I tried the following inside ~/.omnisharp/omnisharp.json but did not work:

{
  "omnisharp.useGlobalMono": "always"
}

@filipw
Copy link
Member

filipw commented Feb 16, 2021

The setting

{
  "omnisharp.useGlobalMono": "always"
}

is a VS Code setting - it is not an omnisharp.json setting. Without VS Code the omnisharp executable has to be started using mono from your PATH e.g. mono Omnisharp.exe. The run script only runs the embedded Mono.

@svermeulen
Copy link
Author

Gotcha. I will continue to just hand-edit the omnisharp run script in that case.

@Zammy
Copy link

Zammy commented Jan 28, 2022

Windows 10. After installing .NET SDK and latest Mono I still get the same error.

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

No branches or pull requests

3 participants