Developing .NET nanoFramework VS Code extension

April 7, 2026 ยท View on GitHub

This document provides details on how to setup your local environment to develop and code for the extension. Along with some general guidelines about it.

Prerequisites

The following packages/tools/frameworks are required on all platforms:

Platform-Specific Requirements

Windows

  • .NET Framework 4.8 (included in Windows 10/11, or install via Visual Studio Build Tools)
  • PowerShell 5.1+ (included) or PowerShell 7+ (recommended)

macOS

  • PowerShell 7+ (required) - macOS 13 (Ventura) or later required

    Install via Homebrew (recommended):

    brew install --cask powershell
    

    Or via .NET Global Tool (if .NET SDK is installed):

    dotnet tool install --global PowerShell
    

    Or download directly from PowerShell Releases

  • Xcode Command Line Tools (recommended):

    xcode-select --install
    

Linux

  • PowerShell 7+ (required)

    Ubuntu/Debian:

    # Install prerequisites
    sudo apt-get update
    sudo apt-get install -y wget apt-transport-https software-properties-common
    
    # Download and register Microsoft repository
    wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
    sudo dpkg -i packages-microsoft-prod.deb
    rm packages-microsoft-prod.deb
    
    # Install PowerShell
    sudo apt-get update
    sudo apt-get install -y powershell
    

    RHEL/Fedora:

    # Register Microsoft repository
    curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
    
    # Install PowerShell
    sudo dnf install -y powershell
    

    Snap (Universal):

    sudo snap install powershell --classic
    
  • mono-complete with msbuild

Note: Do not use the mono-complete package provided by your Linux distribution
as it may not include msbuild which is required for this extension to work.

Instead install the mono-complete package provided by the Mono Project.
The preview version is recommended as the stable version is outdated.

Note: The .slnx solution format requires a recent Mono/MSBuild version.
If your Mono installation does not support .slnx, use the classic .sln format.

Note: If you're running into a langversion:9 error, try installing the latest mono-nightly.

Verify PowerShell Installation

Before proceeding, verify PowerShell is installed correctly:

pwsh --version
# Should output: PowerShell 7.x.x

Install steps

  1. Clone repository and cd into it
  2. Run npm install
  3. Run the build script:
    • Windows (PowerShell 5.1+): .\scripts\build.ps1
    • Windows (PowerShell 7+): pwsh .\scripts\build.ps1
    • macOS/Linux: pwsh scripts/build.ps1 or ./scripts/build.sh
  4. Open in Visual Studio Code (code .)

Debugging extension

  • Press F5 to debug
  • Set breakpoints at will
  • Move to the new VS Code instance window
  • Load a directory with a project or go to Command Palette and choose one of the nanoFramework commands

Dependencies

The extension uses the following key npm packages:

  • serialport - Cross-platform serial port enumeration (native bindings auto-installed)
  • axios - HTTP client for firmware downloads
  • globby - File pattern matching

Native bindings for serialport are automatically downloaded during npm install for your platform.

Updating the dependencies

The extension depends on .NET nanoFramework msbuild components provided by the VS extension. To update to a new version go to the build.ps1 and set the $vsExtensionVersion variable to the desired Git tag. Make sure to commit these update changes in an individual commit to the upstream repository.