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

Install requires an internet connection #955

Closed
jkingston opened this issue Nov 16, 2016 · 11 comments
Closed

Install requires an internet connection #955

jkingston opened this issue Nov 16, 2016 · 11 comments

Comments

@jkingston
Copy link

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
Copy link
Contributor

@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
Copy link
Member

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
Copy link
Author

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
Copy link
Member

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
Copy link

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
Copy link
Member

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
Copy link

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
Copy link
Member

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

@Pale91
Copy link

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
Copy link

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/

@suhail-sirat
Copy link

When i run: node_modules/gulp/bin/gulp.js package:offline
it gives me this:

[11:12:53] Requiring external module ts-node/register
[11:12:59] Using gulpfile ~/Desktop/CSharp/vscode-csharp/gulpfile.ts
[11:12:59] Starting 'package:offline'...
[11:12:59] Starting 'vsix:release:package'...
[11:12:59] Starting 'vsix:release:package:windows'...
[11:12:59] Starting 'vsix:release:package:windows:win32-x64'...
2.18.2
Setting package version to 2.18.2
Packaging release version.
Reusing existing download of microsoft.codeanalysis.languageserver.win-x64.4.10.0-2.24102.11
Extracting content from /home/suhail/Desktop/CSharp/vscode-csharp/out/.nuget/microsoft.codeanalysis.languageserver.win-x64/4.10.0-2.24102.11/content/LanguageServer/win-x64
Determining projects to restore...
Failed to download package 'Microsoft.AspNetCore.App.Ref.7.0.15' from 'https://pkgs.dev.azure.com/azure-public/3ccf6661-f8ce-4e8a-bb2e-eff943ddd3c7/_packaging/36a629e1-6c5b-4bcd-aa2e-6018802d6b99/nuget/v3/flat2/microsoft.aspnetcore.app.ref/7.0.15/microsoft.aspnetcore.app.ref.7.0.15.nupkg'.
Response status code does not indicate success: 401 (Unauthorized - No local versions of package 'microsoft.aspnetcore.app.ref'; please provide authentication to access versions from upstream that have not yet been saved to your feed. (DevOps Activity ID: C1369340-D4B6-4DC1-BFEE-4DD6BB350345)).
.
.
.

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

No branches or pull requests

6 participants