Omnisharp-vscode: C# extension files fail to install with error 'invalid central directory file header'

Created on 15 Aug 2017  路  17Comments  路  Source: OmniSharp/omnisharp-vscode

_From @GuruprasadYellappaK on August 14, 2017 15:15_

Hello,

I have an issue with debugging .NET console and web application from Visual studio code and when i run with debug getting the below Error. I am not sure, what is missing. even after reinstalling again the same issue continues.

Run 'Debug: Download .NET Core Debugger' in the Command Palette or open a .NET project directory

below is the dotnet --info result

.NET Command Line Tools (1.0.4)

Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e6684fd

Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.4

Kindly suggest.

Regards,
Guruprasad

_Copied from original issue: Microsoft/vscode#32485_

Question

Most helpful comment

VS Code supports three properties in your Preferences->Settings file that control HTTP proxy usage. Can you try setting them to the same thing you have in your browser?

There are more details on this at https://code.visualstudio.com/docs/setup/network

  // The proxy setting to use. If not set will be taken from the http_proxy and https_proxy environment variables
  "http.proxy": "",

  // Whether the proxy server certificate should be verified against the list of supplied CAs.
  "http.proxyStrictSSL": true,

  // The value to send as the 'Proxy-Authorization' header for every network request.
  "http.proxyAuthorization": null,

All 17 comments

_From @waacton on August 15, 2017 9:34_

I have the same issue, and the same dotnet --info result.

In my case I assume it also coincides with not being able to install the dependencies properly:

Updating C# dependencies...
Platform: win32, x86_64

Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' (21928 KB) ....................    Retrying from 'https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.23.2.zip' (21928 KB) .................... Done!
Downloading package '.NET Core Debugger (Windows / x64)' (39217 KB) ....................    Retrying from 'https://vsdebugger.blob.core.windows.net/coreclr-debug-1-12-5/coreclr-debug-win7-x64.zip' (39217 KB) .................... Done!

Installing package 'OmniSharp for Windows (.NET 4.6 / x64)'
Failed at stage: installPackages
Error: invalid central directory file header signature: 0xb5110011

Finished

Any thoughts on what's going on here?

@waacton: that error means that the downloaded zip file was corrupt by the time it reached your machine. Can I ask you what region of the world you are downloading from? About how long did the downloads take? If you try and hit the following two URLs in a browser, what do you get?

https://download.visualstudio.microsoft.com/download/pr/11114590/f5469e805c6dcbe675e6a1d94fd78cc0/omnisharp-win-x64-1.23.2.zip
https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.23.2.zip

@gregg-miskelly I'm downloading from Germany. The initial OmniSharp package download takes ~7 minutes before the retry, which apparently takes ~1 minute and then it's done.

I was able to download the zip files from the URLs you provided in just under 2 minutes.

Some kind of issue with my network?

@waacton to make sure I understand, you are saying it spent 7 minutes trying to download the item initially. After 7 minutes it spit out the 'Retrying' message, and it spent ~1 minute downloading from the fall back?

If you restart VS code are you still experiencing the invalid central directory file header signature problem?
Are you using any sort of HTTP proxy?

I am able to download manually from the link you provided. but same is not working from VS code.

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.23.2.zip' Downloading package '.NET Core Debugger (Windows / x64)' Retrying from 'https://vsdebugger.blob.core.windows.net/coreclr-debug-1-12-5/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

Do you use any sort of HTTP proxy?

This is the json file. I am using
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug//.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"console": "internalConsole"
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/mvc.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}

No, sorry an HTTP proxy would be something you would have configured in your web browser settings. For example, if you are working on a company's network, you might be required to use an HTTP proxy. You can find an explanation of HTTP proxies here: https://en.wikipedia.org/wiki/Proxy_server.

I ask because we have had a few people with download troubles caused by having the proxy settings in VS Code be different from the proxy settings configured in their web browser.

We are using Intranet so using proxy server settings in Lan settings. but I am able to download manually when i access directly from browser. is there something can we bypass this for VS code. or any changes from VS code settings.
Please suggest.

VS Code supports three properties in your Preferences->Settings file that control HTTP proxy usage. Can you try setting them to the same thing you have in your browser?

There are more details on this at https://code.visualstudio.com/docs/setup/network

  // The proxy setting to use. If not set will be taken from the http_proxy and https_proxy environment variables
  "http.proxy": "",

  // Whether the proxy server certificate should be verified against the list of supplied CAs.
  "http.proxyStrictSSL": true,

  // The value to send as the 'Proxy-Authorization' header for every network request.
  "http.proxyAuthorization": null,

Thank you so much.
finally issue got resolved :)

Great!

Problem resolved by setting proxy of VS code.
One thing is strange (but is not related to omnisharp) is that VS code can download and install Extensions from marketplace without proxy settings (by using system proxy I think). But it couldn't download dependencies without proxy settings in its settings.json.

Hi, this solution works like a charm ! been struggling to find an easy way out. Thanks a ton !

I have still trouble installing omnisharp on VS Code Portable.

Both manually downloaded and also unzipped dependencies cannot be recognized by VS Csharp installer.

Also changing network settings cannot help

@hellboy81 Can you post the C# and the OmniSharp log here. It can be obtained by View--> Output. In the output pane, on the right side you can find both these channels.

Was this page helpful?
0 / 5 - 0 ratings