Skip to content

Install and Configure Visual Studio Code

To build Xrt applications using Visual Studio on Windows, complete the following steps:

  1. Install Visual Studio Code, if not already installed.

  2. Install Build Tools.

  3. Install the following extensions:

    • Azure Sphere
    • CMake Extensions
  4. Install ncat (part of Nmap) (optional)

  5. Navigate to the Azure Sphere example in the VS Code explorer.

    Open .vscode/settings.json

    • Ensure the value of the "DEVICE" configuration is set to the required device service, for example, bacnet or ethernet-ip.
    • Ensure the value of the "BOARD" configuration is set to the required board type. The options are mt3620-dk, mt3620-g100, mt3620-sk or mt3620-sr620.
  6. Configure the Application Manifest.

    Open the app_manifest.json in the directory matching the board type, for example, mt3620-dk/app_manifest.json

  7. Attach your Azure Sphere development board to your PC with the USB cable.

  8. Start a UDP listener (optional). This allow application logging output to be viewed as log messages are created.

    • Open a command window or PowerShell.

    • Issue the command: PC running ncat.

    ncat -l 1999 --keep-open --udp --recv-only
    
  9. Configure the digital twin. See Configuring Xrt Using a Device Twin.

  10. Build the application.

    • Select the VSCode CMake view in the Activity Bar (leftmost column).
    • Click the "Build" button in the Status Bar (bottom of the window).
  11. Deploy and Debug the application.

    • Select the VSCode Run and Debug view in the Activity Bar (leftmost column).
    • Press F5 to download the application to your Azure Sphere board, the application will then start under the control of the debugger built into VS Code.