Error on installing C# Extension for VSCode

Viewed 4973

I am trying to install the VSCode Extension C# for Visual Studio Code (powered by OmniSharp) without any success. In the Output tab of VSCode I am getting the following error:

Updating 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.26.3.zip' Downloading package '.NET Core Debugger (Windows / x64)'   Retrying from 'https://vsdebugger.blob.core.windows.net/coreclr-debug-1-13-0/coreclr-debug-win7-x64.zip' 
Installing package 'OmniSharp for Windows (.NET 4.6 / x64)'
Failed at stage: installPackages
Error: end of central directory record signature not found

Finished
2 Answers

According to the related issues I found on the omnisharp-vscode GitHub page here:

and knowing I am behind an enterprise proxy, I had to set the http.proxy setting in vscode like that in my vscode user settings:

{
    "http.proxy": "<my-proxy-uri>" // e.g. http://1.2.3.4:55,
}

Its always better to check why the download of omnisharp failed.

enter image description here

You can do check by switching the tab to Output and then changing the drop down menu to OmniSharp Log

enter image description here

For me the errors were different each time ,most of the time it was the corporate proxy and next time it was in-compatible c# extension with omnisharp being downloaded.

This issue occurs mainly because VS code is trying to download and install the file automatically which is prevented by corporate proxy.

To tackle the issue download the file manually by clicking on the errored link,

Close the Vs Code ,Manually extract the downloaded zip and paste in the location based on omnisharp log.

Now you must be good to go.

Related