how do I get the Omnisharp extension to work in Visual Studio Code

krazyk4tlady picture krazyk4tlady · Jan 10, 2019 · Viewed 10.9k times · Source

In Visual Studio Code I tried to install the Omnisharp extension so that I can get formatting (among other things).

this is the c# log: Installing C# dependencies... Platform: win32, x86_64

Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' Retrying from 'https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.32.8.zip' Failed at stage: downloadAndInstallPackages Error: connect ETIMEDOUT 93.184.215.201:443

You can also tell the extension didn't install by the Omnisharp log error: Starting OmniSharp server at 1/9/2019, 4:17:59 PM Target: c:\Users[myUserId]\source\project-folder OmniSharp server started. Path: C:\Users[myUserId].vscode\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.32.8\OmniSharp.exe PID: 15188

The system cannot find the path specified. [ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

It seems like the version 1.32.8 is not available, but https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.30.1.zip is. I downloaded the package, extracted filed, and tried to placed the folder where it's expected: C:\Users[myUserId].vscode\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.30.1\OmniSharp.exe -- but windows doesn't allow folder names starting with a dot in this location. I thought I had figured out a solution and I didn't.

Answer

Suraj Yadav picture Suraj Yadav · Apr 26, 2019

I had the problem previously. So did setup proxy and other at settings.json. But now in new VS Code, i was getting same problem weirdly. Finaly when i emptied out the settings.json file (deleted all the settings) VS code is working. It automatically downloads C# and other extentions. So, give it a try, if you had some settings put there for previous versions of VS Code, you got to remove(comment) them to check if thats cuasing problems. [You dont have proxy, but if someone have, 'yes of course proxy needed to setup for .npmrc and enviroment variables at cmd as internet is necessary to download files]