Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add devcontainer support #37412

Merged
merged 16 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v8.0/containers/dotnet
{
"name": "dotnet",
"image": "mcr.microsoft.com/devcontainers/base:debian",
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csdevkit",
"EditorConfig.EditorConfig",
"DavidAnson.vscode-markdownlint"
]
}
},
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash -i ${containerWorkspaceFolder}/.devcontainer/scripts/post-creation.sh",
// Add the locally installed dotnet to the path to ensure that it is activated
// This is needed so that things like the C# extension can resolve the correct SDK version
"remoteEnv": {
"PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}"
}
}
4 changes: 4 additions & 0 deletions .devcontainer/scripts/post-creation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Install SDK and tool dependencies before container starts
# Also run the full restore on the repo so that go-to definition
# and other language features will be available in C# files
./restore.sh
baronfel marked this conversation as resolved.
Show resolved Hide resolved