This assumes you already have the Dev Containers extension installed in VSCode.
- Start Docker (on a Mac:
open -a Docker
) - Open the project in Visual Studio Code (VS Code)
- Click: Reopen in Container
- Select: View / Terminal (may already be open)
- In the VSCode Terminal window run this command:
dotnet run
- Create a project folder and cd to it
- Open the project in VS Code
- Open the Command Palette (Cmd+Shift+P on a Mac)
- Type in Dev Containers: Add Dev Container Configuration Files ...
- Select C# and go through the steps
- Press Reopen in Container when prompted
- Open up the VSCode Terminal window: View / Terminal on a Mac
- Create a new console project:
dotnet new console
- Run the project:
dotnet run
- Add a .gitignore file
dotnet new gitignore