Configure Visual C++ 2019 for Linux Development

This focuses mainly on the development of Linux server apps. This article is based on Microsoft's docs.

See also: Build and run Blazor WASM projects on Linux

Visual Studio 2019

  1. Open Visual Studio 2019 and choose to create a new project. Search for Linux projects and choose Console Application with the "hello" example.

  2. Choose your project's architecture.

  3. Install prerequisite packages on the Linux machine: openssh server, g++, gdb and gdb server

    On Ubuntu, issue this command:

    sudo apt-get install openssh-server g++ gdb gdbserver make ninja-build rsync zip

    On Fedora/CentOS, be logged in as user root and issue this command:

    yum install openssh-server g++ gdb gdb-gdbserver ninja-build make rsync zip
  4. Hit the F5 key and the project will try to connect to a remote system. Enter the host machine's IP address, user name and password.

  5. To add another connection/remote machine, go to Tools > Options and search for Connection Manager.

  6. To change the connection/remote machine the project is using, go to the project's properties and change Remote Build Machine.

  7. Choose the project's configuration type: Dynamic Library, Static Library or Application (in this example, Application).

  8. Hitting the F5 key should run the application on the host machine and show the output in the Linux Console Window (at the bottom of the screen). Breakpoints can be set for the debugger.

Microsoft's docs recommend changing more settings but these seem to be out of date because these recommendations break the entire process.

Cookies are simple text files stored on the user's computer. They are used for adding features and security to this site.