Extend and use for your Web Development lessons in minutes.
This .NET Codespaces template provides you a normalized environment for you to build your class on. No setup time needed from you or your students, allowing you to focus on the content and lessons.
- Who is this for? Educators of all levels.
- How much experience do students need? Zero. This template is built with basic elements complete with comments so it can be used in beginner to advanced lessons.
- Can I use this template for other .NET applications? Absolutely. This template uses ASP.NET web app and API app as examples.
- Prerequisites: None. This template will provide a working and deployable web app and API app you can immediately extend for your needs.
🚀 Codespaces features:
- Repeatable cloud environment offering a push-button experience.
- Can be configured and customized.
- Integrates with your repositories on GitHub and Visual Studio Code.
As a teacher that means that you can create an environment, in the cloud, for your class that all students can use with zero or next to zero configuration regardless of what operating system they are using.
A Codespace is a development environment that's hosted in the cloud that you can configure. The Codespaces Education benefit gives Global Campus teachers a free monthly allowance of GitHub Codespaces hours to use in GitHub Classroom. Learn more here about Using GitHub Codespaces with GitHub Classroom.
If you are not already a Global Campus teacher, apply here or for more information, see Apply to GitHub Global Campus as a teacher.
This template repository contains:
.devcontainer
settings:Dockerfile
: defines the devcontainer image for GitHub Codespaces that determines the operating system and .NET version.devcontainer.json
: declares the devcontainer configuration for GitHub Codespaces including extensions and tools to be pre-installed, and workspace settings.post-create.sh
: describes additional tools to be pre-installed.
- ASP.NET web app: A sample web app
- ASP.NET API app: A sample API app
README
: this file – describes this repository and what's in it.
-
Create a repository from this template. Use this create repo link. You can make the repository private or public, up to you.
-
Navigate to the main page of the newly created repository.
-
Under the repository name, use the Code drop-down menu, and in the Codespaces tab, select "Create codespace on main".
-
Wait as Github initializes the codespace:
Customize your project for GitHub Codespaces by committing configuration files to your repository (often known as Configuration-as-Code), which creates a repeatable Codespaces configuration for all users of your project.
You can configure things like:
- Extensions, you can specify what extensions should be preinstalled.
- Dotfiles and settings.
- Operating system libraries and dependencies
💡 Learn more about customization and configuration in the official documentation
By default, this devcontainer settings uses the base image of .NET 8.0 on Ubuntu LTS 22.04 by default. You can change the base image to one in the list.
"build": {
"dockerfile": "./Dockerfile",
"context": ".",
"args": {
"VARIANT": "8.0-jammy"
}
}
-
Azure CLI: Uncomment the section under the
features
attribute."features": { ... "ghcr.io/devcontainers/features/azure-cli:1": { "version": "latest" } ... },
-
GitHub CLI: Uncomment the section under the
features
attribute."features": { ... "ghcr.io/devcontainers/features/github-cli:1": { "version": "latest" } ... },
-
node.js: Uncomment the section under the
features
attribute. The latest LTS version of node.js is chosen by default."features": { ... "ghcr.io/devcontainers/features/node:1": { "version": "lts", "nodeGypDependencies": true, "nvmInstallPath": "/usr/local/share/nvm" } ... },
🔍 If you want to add more features, find this repository: devcontainer features.
-
There are optional extensions pre-installed under the
customizations.vscode.extensions
attribute."customizations": { "vscode": { "extensions": [ "GitHub.copilot", "GitHub.copilot-chat", "ms-dotnettools.csdevkit", "ms-vscode.PowerShell", "ms-vscode.vscode-node-azure-pack", "VisualStudioExptTeam.vscodeintellicode" ], ... } }
🔍 Alternatively, you can add as many extra extensions as you like, from Visual Studio Code Marketplace.
You can pre-install any tool through on-create.sh
, which the devcontainer features don't natively support yet. eg) PowerShell.
-
If you want to install oh-my-posh for PowerShell, uncomment the section below
## OH-MY-POSH ## # Uncomment the below to install oh-my-posh sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh sudo chmod +x /usr/local/bin/oh-my-posh
🔍 There are more customization scenarios in
on-create.sh
, if you like to follow.
- GitHub Codespaces docs overview
- GitHub Codespaces docs quickstart
- Using GitHub Codespaces with GitHub Classroom
Help us make this template repository better by letting us know and opening an issue!.