visual-studio-code

How can I install Visual Studio Code extensions offline?


I have installed Visual Studio Code on a machine that is not, and cannot be, connected to the Internet. According to the documentation, I can install an extension from the command line if I have the .vsix, but I don't know how to get the .vsix from the marketplace.

How can I download the .vsix for an extension hosted on the marketplace?


Solution

  • UPDATE 2017-12-13

    You can now download the extension directly from the marketplace.

    Enter image description here

    As of Visual Studio Code 1.7.1 dragging or opening the extension does not work any more. In order to install it manually you need to:

    Install from VSIX...


    Old Method

    According to the documentation it is possible to download an extension directly:

    An extension's direct download URL is in the form:

    https://${publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${publisher}/extension/${extension name}/${version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
    

    This means that in order to download the extension you need to know

    You can find all this information in the URL.

    Example

    Here's an example for downloading an installing the C# v1.3.0 extension:

    Publisher, Extension and Version

    You can find the publisher and the extension names on the extension's homepage inside its URL:

    https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp

    Here the publisher is ms-vscode and the extension name is csharp.

    The version can be found on the right side in the More Info area.

    To download it you need to create a link from the template above:

    https://ms-vscode.gallery.vsassets.io/_apis/public/gallery/publisher/ms-vscode/extension/csharp/1.3.0/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

    All packages will have the same name Microsoft.VisualStudio.Services.VSIXPackage, so you'll need to rename it after downloading if you want to know what package it was later.

    Installation

    In order to install the extension

    Extension was successfully installed. Restart to enable it.