This project is derived from a VS Code focused Try Development Container repo for C++. It was changed to use a Visual Studio CMake project as the base example instead of a simpler Hello World without CMake. The instructions below are also focused on just Visual Studio as opposed to Codespaces and VS Code.
A development container is a running Docker container with a well-defined tool/runtime stack and its prerequisites. You can try out development containers with GitHub Codespaces or Visual Studio Code Remote - Containers.
If you already have Visual Studio 2022 17.4 Preview 2 with the Linux workload and Docker installed, you can clone the source code and open the folder in Visual Studio and get going.
Dev Containers for C++ in Visual Studio has a full write up of the experience.
- If this is your first time using a development container, please ensure your system meets the pre-reqs (i.e. have Docker installed) in the getting started steps.
Once you have this sample opened, you'll be able to work with it like you would locally.
Some things to try:
- Edit:
- Open
main.cpp
- Try adding some code and check out the language features.
- Open
- Terminal: Press ctrl+shift+` and type
uname
and other Linux commands from the terminal window. - Build, Run, and Debug:
- Open
MyCppApp.cpp
- Add a breakpoint (e.g. on line 10).
- Press F5 to launch the app in the container.
- Once the breakpoint is hit, try hovering over variables, examining locals, and more.
- Open
Copyright © Microsoft Corporation All rights reserved.
Licensed under the MIT License. See LICENSE in the project root for license information.