Create an Visual Studio Extension and deploy it locally

Prerequisites

node, npm and yo have to be installed

Globally install npm package generator-code

Then we need to install the npm package generator-code globally

npm install -g generator-code

Create VS Code Extension project

With generator-code installed we can start creating an VS Code Extension project

yo code

 

 

 

 

 

Globally install npm package vsce

This is the VS Code Extension Manager and it is required to generate VSIX files, which can be used to deploy VS Code Extensions.

npm install -g vsce

Generate VSIX file for the VS Code Extension

Go to the folder of the new created VS Code Extension project and execute

vsce package

Install VS Code Extension locally

After the VSIX file has been successfully generated (for example test001-0.0.1.vsix) execute the following command to install the extension locally.

code --install-extension .\test001-0.0.1.vsix

Leave a Reply