Hello OmniSharp on .NET 6.0!

On December 15, 2021 we released version 1.38.0 of OmniSharp which, for the first time, included .NET 6.0 builds of the OmniSharp server. The related feature branch was maintained for over a year, and previously contained a .NET 5-based variant of OmniSharp, though that one was never released.

This is a big milestone in the OmniSharp project as the .NET 6.0 build is much faster and a lot more stable, and is the first step towards retiring the .NET Framework/Mono builds of OmniSharp.

What's in there?

There is now a new .NET 6.0 build of OmniSharp published as build artifact. It gets published for the following RIDs:

  • win7-x64
  • win7-x86
  • win10-arm64
  • osx-x64
  • osx-arm64
  • linux-x64
  • linux-arm64

This of course means that we now have native builds for ARM as well, which is very cool. I myself worked on developing this from my M1 Mac, dogfooding OmniSharp and it has been a real joy seeing that work.

OmniSharp .NET 6.0 is published as framework dependent application, not a standalone application, meaning it requires .NET 6.0 SDK to be installed on your machine. The reason is with this variant OmniSharp no longer bundles its own MSBuild but instead uses one from the SDK. Since SDK is needed for MSBuild, we take advantage of it to run OmniSharp as well, because it solves certain distribution problems that arise when using self-contained applications, most notably, code signing is required for self-contained MacOS applications.

Note that OmniSharp supports older .NET/.NET Core versions as well, as long as you have the necessary SDK installed, it's just for its own startup it requires you to have .NET 6.0 SDK available.

OmniSharp still ships STDIO and HTTP variants, and both have been upgraded to .NET 6.0. Ready to run is enabled for better startup times. There is still a lot of room for performance improvements (performance was not so much in focus in this exercise) but nevertheless the important foundational work has been done and the behavior of the server is clearly much much better.

Non-SDK-style .NET Framework projects are not supported by the .NET 6.0 build of OmniSharp. For opening legacy .NET Framework projects, the global Mono O# variant is still needed (*nix) or the .NET Framework O# variant (Windows), as in the past. This includes Unity projects, however there are some signs from the Unity space that they might be moving away from .NET Framework towards .NET 6.0 too, which would of course simplify things.

We will continue shipping OmniSharp as both .NET 6.0 and .NET Framework/Mono applications concurrently for now, though we plan to get rid of the "embedded Mono" variant of OmniSharp. It only exists to support modern .NET SDK style projects and going forward this job is intended to be handled by .NET 6.0 build of OmniSharp.

How to get it?

If you are acquiring OmniSharp manually, or you are in a non-VS Code editor, then typically you would simply head of to the release page and download the OmniSharp release that is relevant for your platform. The .NET 6.0 builds are all suffixed with net6.0. The old builds based on .NET Framework/Mono are still being published as well.

If you are using VS Code and its C# extension, then the corresponding extension build 1.24.0 was released on January 22, 2022 so chances are your VS Code would have already updated to it. By default the .NET Framework/Mono variants are still used, but you can opt into having the .NET 6.0 builds by setting the following in your VS Code settings

On the next start, the .NET 6.0 OmniSharp build relevant for your platform (e.g. osx-arm64) will be downloaded and used from that point on. This setting will be switched on by default at some point in the future.

Thanks to everyone that made this big thing happen!