Runar Ovesen Hjerpbakk

Programmer. Software Architect. Technical Manager.

Change the OmniSharp version being used by Visual Studio Code

Visual Studio Code (VS Code) is a great code editor for any platform. And perfect for .Net scripting! I use it to edit my scripts written in dotNet Script. dotNet Script has a lively community with new features being added regularly. VS Code is a collection of different libraries and frameworks, all working together to give you that good experience. Thus, if your new favorite scripting language gets a new feature, it sometimes takes a little while for the tooling to catch up.

This time it was OmniSharp-Roslyn, the library handling project dependencies and language syntax for VS Code, which had issues when adding NuGet packages in dotNet Script.

Red squiggles even though the code is correct

Thankfully, it’s easy to point VS Code to a new version of OmniSharp.

  1. Download the latest release of OmniSharp-Roslyn and extract it to a suitable location.
  2. Update your User Settings with the path to the extracted OmniSharp.exe. If you’re on macOS, remember to also use mono as the runtime:

    {
      "omnisharp.path": "/Users/sankra/OmniSharp/OmniSharp.exe",
      "omnisharp.useMono": true
    }
    
  3. Restart VS Code.

VS Code User Settings

Enjoy your updated and hopefully functioning IntelliSense 😃

It works!