I have been using VSCode + C# Extension + Omnisharp for quite sometime on my MAC to learn dotnet core development. Recently, after I upgraded VS Code to 1.3.1, I found the Omnisharp wasn’t getting downloaded and installed [though I don’t think version upgrade has anything to do here, the last time it was working was in the previous version 1.2]. Usually, if your machine is behind a corporate firewall, you will have to provide appropriate credentials to authenticate against proxy servers. I have faced issues in installing VS Code extensions because of proxy authentication. To overcome, you can update the settings.json with the below settings

{
  "http.proxyStrictSSL": false,
  "http.proxy": "http://myusername:password@proxyserver:port",
  "https.proxy": "http://myusername:password@proxyserver:port"
}

I made the above change and after that extensions start getting installed properly. However, I started getting weird issue with the Omnisharp installation. Once you install C# extension for VS Code, upon opening any of the C# project for the first time, omnisharp will get installed automatically. In my case, that wasn’t happening successfully. I was getting the below error in my Output window


Attempting to download omnisharp to /Users/Swami/.vscode/extensions/ms-vscode.csharp-1.3.0/out/.omnisharp-coreclr ...

And no progress after that. Nothing else was getting logged. To identify the real root cause, I had to Toggle developer tools from Help > Toggle Developer Tools

The console logs showed the below logs

Uncaught Exception: Error: self signed certificate in certificate chain

I have tried every other option mentioned to specify http_proxy and https_proxy environment variables, but in vain. I have created this SO question on the same. Finally, I overcame this issue with the below workaround

  1. Open the download.js present within the folder Users/Swami/.vscode/extensions/ms-vscode.csharp-1.3.0/out/omnisharp and take the download url. The url in my case was https://omnisharpdownload.blob.core.windows.net/ext
  2. From the Omnisharp log under VS Code’s output window you can pick up the file it tries to download which was omnisharp-1.9-beta12-osx-x64-netcoreapp1.0.tar.gz
  3. Download this file manually and extract the contents & place under  Users/Swami/.vscode/extensions/ms-vscode.csharp-1.3.0/out/.omnisharp-coreclr
  4. Now open any of your existing C# solution/project, Omnisharp should start running successfully.

I am still trying to get the right solution for this. I would be happy to hear if you have fixed the actual issue. Until then, if you are stuck like me, feel free to try out this workaround.

Advertisements