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

Install requires an internet connection #955

Closed
jkingston opened this Issue Nov 16, 2016 · 10 comments

Comments

Projects
None yet
5 participants
@jkingston

jkingston commented Nov 16, 2016

Environment data

VS Code version: 1.7.1
C# Extension version: 1.5.1

Steps to reproduce

  1. Download OmniSharp 1.5.1 vsix file
  2. Install VS Code
  3. Disconnect from internet
  4. Install extension

Expected behavior

Extension should be full-featured when editing C# code.

Actual behavior

An error is written to the VS Code output log when attempting to download the OmniSharp-Roslyn package for the platform.

On my computer at work I do not have a direct internet connection making installing this extension extremely difficult. Ideally a self-contained distribution that includes the dependencies would be made available with each release.

@gregg-miskelly

This comment has been minimized.

Contributor

gregg-miskelly commented Nov 16, 2016

@jkingston what you are asking for isn't possible with VS Code -- VS Code doesn't support uploading a collection of .vsix files for each platform.

It is possible to create these yourself if you are so inclined --

  1. Enlist in this repo
  2. npm i
  3. npm run compile
  4. node node_modules/gulp/bin/gulp.js package:offline

Take the .vsix for the platform you would like.

@DustinCampbell

This comment has been minimized.

Collaborator

DustinCampbell commented Nov 16, 2016

This is working as designed. The extension has several platform-specific dependencies that must be downloaded before it can work. Once those are downloaded, an internet connection is no longer needed.

We do provide a gulp task for producing "offline" VSIXs that target various platforms. If you are able to clone and build this repo, you can run the gulp package:offline task to produce a VSIX specific to your OS with the necessary dependencies built in.

@jkingston

This comment has been minimized.

jkingston commented Nov 26, 2016

Thank you both for the comments on this and I appreciate the limitations of the VS Code extension gallery in this regard. That said, as my VS Code does not have an internet connection the extension gallery is not much use to me anyway. Would it be possible to publish platform-specific .vsix files via the Github releases page for future releases of this project? If so that would be greatly appreciated.

@DustinCampbell

This comment has been minimized.

Collaborator

DustinCampbell commented Nov 26, 2016

Each platform-specific VSIX is around 40 or 50 MB and there 9 of them. Producing each of them for every single release really isn't practical. Also, they aren't officially supported. That's why we provide a way to produce platform-specific VSIXs specifically for scenarios like yours. It's a bit DIY, but did you try the instructions above?

@Pale91

This comment has been minimized.

Pale91 commented May 4, 2017

I followed the instructions of @gregg-miskelly but I'm getting the next error when I execute "node node_modules/gulp/bin/gulp.js package:offline"

*Error: Do not build offline packages on windows. Runtime executables will not be marked executable in nix packages.
at doOfflinePackage (C:\Users\a.palmer\Documents\VS Code C# - GitHub\omnisharp-vscode-master\gulpfile.js:95:15)
at promise.then (C:\Users\a.palmer\Documents\VS Code C# - GitHub\omnisharp-vscode-master\gulpfile.js:141:24)
at process._tickCallback (internal/process/next_tick.js:109:7)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:425:7)
at startup (bootstrap_node.js:146:9)
at bootstrap_node.js:540:3

@DustinCampbell

This comment has been minimized.

Collaborator

DustinCampbell commented May 4, 2017

@Pale91: That's kind of terrible. 😄 Sorry about that!

If you're just building a Windows offline installer for yourself, change line 95 in gulpfile.js from...

throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.');

...to...

console.log('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.');
@Pale91

This comment has been minimized.

Pale91 commented May 5, 2017

@DustinCampbell: Thanks for the answer.
But now I'm getting the next error when installing .NET Core Debugger

Installing package '.NET Core Debugger (Windows / x64)'
[05:52:24] 'package:offline' errored after 15 h
[05:52:24] Error: Immediate zip file error
at yauzl.fromFd (C:\Users\a.palmer\Documents\VS Code C# - GitHub\omnisharp-vscode-master\out\src\packages.js:227:31) at C:\Users\a.palmer\Documents\VS Code C# - GitHub\omnisharp-vscode-master\node_modules\yauzl\index.js:183:5
at Immediate. (C:\Users\a.palmer\Documents\VS Code C# - GitHub\omnisharp-vscode-master\node_modules\yauzl\index.js:611:38)
at runCallback (timers.js:666:20)
at tryOnImmediate (timers.js:639:5)
at processImmediate [as _immediateCallback] (timers.js:611:5)

@DustinCampbell

This comment has been minimized.

Collaborator

DustinCampbell commented May 7, 2017

It sounds to me like the download of the debugger file didn't succeed and so the unzip operation failed.

@Pale91

This comment has been minimized.

Pale91 commented May 9, 2017

@DustinCampbell thanks for all. I already accomplished.
I had some problems downloading .Net Core Debugger but at the end I downloaded the package manually from the url in the package.json and then unzipped in .debugger folder in the root project. I did minor changes in the gulpfile.js and executed node node_modules/gulp/bin/gulp.js package:offline. All worked OK.

@ajtowf

This comment has been minimized.

ajtowf commented Jul 5, 2017

Just ran into this, wrote a complete guide if somebody else want's to know what minor changes needs to be done to the gulpfile to build the VSIX-file on a windows machine:

https://www.towfeek.se/2017/07/05/enabling-csharp-and-dotnet-core-debugging-in-vs-code-from-an-offline-environment/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment