Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# extension files fail to install with error 'invalid central directory file header' #1712

Closed
weinand opened this issue Aug 15, 2017 · 17 comments
Labels

Comments

@weinand
Copy link

weinand commented Aug 15, 2017

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

@weinand
Copy link
Author

weinand commented Aug 15, 2017

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?

@gregg-miskelly
Copy link
Contributor

@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 gregg-miskelly changed the title Run 'Debug: Download .NET Core Debugger' in the Command Palette or open a .NET project directory C# extension files fail to install with error 'invalid central directory file header' Aug 15, 2017
@waacton
Copy link

waacton commented Aug 16, 2017

@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?

@gregg-miskelly
Copy link
Contributor

@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?

@GuruprasadYellappaK
Copy link

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

@GuruprasadYellappaK
Copy link

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

@gregg-miskelly
Copy link
Contributor

Do you use any sort of HTTP proxy?

@GuruprasadYellappaK
Copy link

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}"
}
]
}

@gregg-miskelly
Copy link
Contributor

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.

@GuruprasadYellappaK
Copy link

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.

@gregg-miskelly
Copy link
Contributor

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,

@GuruprasadYellappaK
Copy link

Thank you so much.
finally issue got resolved :)

@gregg-miskelly
Copy link
Contributor

Great!

@armujahid
Copy link

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.

@avantidesaigit
Copy link

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

@hellboy81
Copy link

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

@akshita31
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants