You can create a codespace in Visual Studio to develop applications in a Windows environment. When you use a codespace in Visual Studio, you can browse source code, build solutions, and commit changes to your repository.
You must create a codespace in Visual Studio to use it with the application. Codespaces created outside of Visual Studio can not currently be used with Visual Studio.
Before you configure a codespace in Visual Studio, you must download the latest version of Visual Studio Preview.
Connecting to GitHub Codespaces with the Visual Studio Preview is not enabled by default, so you will first need to enable the Preview Features option.
- In Visual Studio Preview, use the Tools drop-down menu, then click Options.
- Under Environment, select Preview Features and check the Connect to GitHub Codespaces preview feature.
- You will need to restart Visual Studio for the feature to be available.
- When you launch Visual Studio, the Start Window will show a Connect to a codespace button under "Get started".
- Click Connect to a codespace.
- Click Sign in to GitHub and follow the prompts, or click Create one! to create a new GitHub account and sign into the account.
- Under "Codespace details", type the repository's URL you want GitHub Codespaces to clone into your codespace.
- Optionally, use the Instance type and Suspend after drop-down menus to configure more codespace details.
- Click Create and Connect. GitHub Codespaces will begin preparing the codespace and open Visual Studio after the codespace is ready. The codespace name will appear in the remote indicator in the menu.
- Use the File drop-down menu, and click Connect to a Codespace.
- Under "GitHub Codespaces", click the codespace you want to connect to, then click Connect.
The default codespace environment created by Visual Studio includes popular frameworks and tools such as .NET Core, Microsoft SQL Server, Python, and the Windows SDK. GitHub Codespaces created with Visual Studio can be customized through a subset of
devcontainers.json properties and a new tool called devinit, included with Visual Studio.
The devinit command-line tool lets you install additional frameworks and tools into your Windows development codespaces, as well as run PowerShell scripts or modify environment variables. devinit supports a configuration file called devinit.json, which can be added to your project for creating customized and repeatable development environments. For more information about Windows codespace configuration and devinit, see Customize a codespace in the Visual Studio documentation.