Omnisharp-vscode: Offline package tries to download Razor Language Server

Created on 7 Feb 2019  路  8Comments  路  Source: OmniSharp/omnisharp-vscode

Environment data

VS Code version: 1.31.0
C# Extension version: 1.17.1 (offline build)

Steps to reproduce

  1. Follow the steps to build an offline VSIX package
  2. Install the resulting VSIX in VS Code on a computer with no internet connection
  3. Open VS Code
  4. Open a C# file

Expected behavior

VS Code should load the C# file without trying to download any packages.

Actual behavior

C# output opens with the following output:

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

Downloading package 'Razor Language Server (Windows / x64)' Failed at stage: downloadAndInstallPackages
Error: getaddrinfo ENOTFOUND download.visualstudio.microsoft.com download.visualstudio.microsoft.com:443

Other info

I've tried changing the Razor: Disabled setting to true, but even then it still tries to download Razor when VS Code opens a C# file.

Bug

All 8 comments

@Herohtar Thanks for filing, we'll take a look.

@Herohtar Can you navigate to the extension folder under C:Users...vscodeextensions\ms-vscode-csharp and checking if the .razor folder exists?
Somehow the .razor packages are not being added to the vsix.

@Herohtar We merged a change #2848 that might fix this. Can you try again with the latest clone of master ?

@akshita31 The .razor folder exists under the extension folder, and it looks like it contains the files for that package.

I tried to test using the master branch, but unfortunately, I get an error during the node node_modules/gulp/bin/gulp.js package:offline process.

[15:52:34] Requiring external module ts-node/register
[15:52:35] Using gulpfile ~/omnisharp-vscode/gulpfile.ts
[15:52:35] Starting 'package:offline'...
[15:52:35] Starting 'vsix:offline:package'...
Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' (30604 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for Windows (.NET 4.6 / x64)'

Downloading package '.NET Core Debugger (Windows / x64)' (43127 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (Windows / x64)'

Downloading package 'Razor Language Server (Windows / x64)' (46894 KB).................... Done!
Installing package 'Razor Language Server (Windows / x64)'

starting /home/herohtar/.nvm/versions/node/v8.11.1/bin/node /home/herohtar/omnisharp-vscode/node_modules/vsce/out/vsce package -o /home/herohtar/omnisharp-vscode/csharp.1.18.0-beta7-win32-x86_64.vsix
Executing prepublish script 'npm run vscode:prepublish'...

> [email protected] vscode:prepublish /home/herohtar/omnisharp-vscode
> tsc -p ./ && webpack --mode production

Hash: fdc20260dc72b5bac0e1
Version: webpack 4.29.0
Time: 17192ms
Built at: 2019-02-08 15:53:48
           Asset      Size  Chunks             Chunk Names
    extension.js   858 KiB       0  [emitted]  main
extension.js.map  3.65 MiB       0  [emitted]  main
Entrypoint main = extension.js extension.js.map
  [3] external "vscode" 42 bytes {0} [built]
 [22] ./src/common.ts 13.8 KiB {0} [built]
 [24] ./src/omnisharp/loggingEvents.ts 29.1 KiB {0} [built]
[147] ./src/packageManager/downloadAndInstallPackages.ts 6.82 KiB {0} [built]
[158] ./src/packageManager/isValidDownload.ts 2.42 KiB {0} [built]
[159] ./src/platform.ts 14.4 KiB {0} [built]
[160] ./src/coreclr-debug/activate.ts 14.4 KiB {0} [built]
[161] ./src/constants/CSharpExtensionId.ts 783 bytes {0} [built]
[180] ./src/main.ts 17.5 KiB {0} [built]
[181] ./src/omnisharp/extension.ts 20.8 KiB {0} [built]
[267] ./src/observers/WarningMessageObserver.ts 4.11 KiB {0} [built]
[269] ./src/observers/CsharpChannelObserver.ts 2.11 KiB {0} [built]
[270] ./src/observers/CsharpLoggerObserver.ts 12 KiB {0} [built]
[272] ./src/observers/DotnetChannelObserver.ts 1.64 KiB {0} [built]
[273] ./src/observers/DotnetLoggerObserver.ts 2.17 KiB {0} [built]
    + 396 hidden modules

WARNING in ./node_modules/microsoft.aspnetcore.razor.vscode/dist/RazorLogger.js 70:11-35
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/microsoft.aspnetcore.razor.vscode/dist/extension.js
 @ ./src/razor/razor.ts
 @ ./src/main.ts
 ERROR  Command failed: npm list --production --parseable --depth=99999
npm ERR! missing: microsoft.aspnetcore.razor.vscode@https://download.visualstudio.microsoft.com/download/pr/3b0ae709-c067-48b4-a658-549ca972e437/386a5dff35391e14f14e5945e7903f63/microsoft.aspnetcore.razor.vscode-1.0.0-alpha2-20181112.3.tgz, required by [email protected]

[15:53:57] 'vsix:offline:package' errored after 1.37 min
[15:53:57] Error: process exited with code 1
    at ChildProcess.<anonymous> (/home/herohtar/omnisharp-vscode/node_modules/async-child-process/lib/join.js:25:22)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
[15:53:57] 'package:offline' errored after 1.37 min

@Herohtar For me it succeeds

Can you try the following:

  1. git clean -xfd
  2. Update to the latest version of node
  3. npm i -g gulp
  4. gulp vsix:offline:package

Here are the logs that I have
```[14:10:37] Requiring external module ts-node/register
[14:10:39] Using gulpfile ~\vscodeextension\omnisharp-vscode\gulpfile.ts
[14:10:39] Starting 'vsix:offline:package'...
Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' (30604 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for Windows (.NET 4.6 / x64)'

Downloading package '.NET Core Debugger (Windows / x64)' (43127 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (Windows / x64)'

Downloading package 'Razor Language Server (Windows / x64)' (46894 KB).................... Done!
Installing package 'Razor Language Server (Windows / x64)'

starting node C:Users\akagarw\vscodeextension\omnisharp-vscode\node_modules\vsce\out\vsce package -o C:Users\akagarw\vscodeextension\omnisharp-vscode\csharp.1.18.0-beta7-win32-x86_64.vsix
Executing prepublish script 'npm run vscode:prepublish'...

[email protected] vscode:prepublish C:Users\akagarw\vscodeextension\omnisharp-vscode
tsc -p ./ && webpack --mode production

Hash: 1a9ed62e17e56865a331
Version: webpack 4.29.0
Time: 9861ms
Built at: 02/08/2019 2:11:11 PM
Asset Size Chunks Chunk Names
extension.js 858 KiB 0 [emitted] main
extension.js.map 3.67 MiB 0 [emitted] main
Entrypoint main = extension.js extension.js.map
[3] external "vscode" 42 bytes {0} [built]
[22] ./src/common.ts 14 KiB {0} [built]
[24] ./src/omnisharp/loggingEvents.ts 29.6 KiB {0} [built]
[147] ./src/packageManager/downloadAndInstallPackages.ts 6.89 KiB {0} [built]
[158] ./src/packageManager/isValidDownload.ts 2.45 KiB {0} [built]
[159] ./src/platform.ts 14.6 KiB {0} [built]
[160] ./src/coreclr-debug/activate.ts 14.6 KiB {0} [built]
[161] ./src/constants/CSharpExtensionId.ts 790 bytes {0} [built]
[180] ./src/main.ts 17.7 KiB {0} [built]
[181] ./src/omnisharp/extension.ts 21 KiB {0} [built]
[267] ./src/observers/WarningMessageObserver.ts 4.15 KiB {0} [built]
[269] ./src/observers/CsharpChannelObserver.ts 2.14 KiB {0} [built]
[270] ./src/observers/CsharpLoggerObserver.ts 12.1 KiB {0} [built]
[272] ./src/observers/DotnetChannelObserver.ts 1.66 KiB {0} [built]
[273] ./src/observers/DotnetLoggerObserver.ts 2.19 KiB {0} [built]
+ 396 hidden modules

WARNING in ./node_modules/microsoft.aspnetcore.razor.vscode/dist/RazorLogger.js 70:11-35
Critical dependency: the request of a dependency is an expression
@ ./node_modules/microsoft.aspnetcore.razor.vscode/dist/extension.js
@ ./src/razor/razor.ts
@ ./src/main.ts
DONE Packaged: C:Users\akagarw\vscodeextension\omnisharp-vscode\csharp.1.18.0-beta7-win32-x86_64.vsix (1250 files, 118.1MB)`

@akshita31 Thanks, that fixed the build error.

And it looks like the changes in master fixed the attempted download issue.

@Herohtar Glad you got it working 馃崱

This is still happening, I've been trying to get passed this process for two days to no avail. smh

Was this page helpful?
0 / 5 - 0 ratings