From 811ca324c1ddfb494f77ce782336c9944e890c03 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 2 Apr 2024 11:59:19 -0700 Subject: [PATCH 1/5] add devcontainer.json config for .net 6 --- .devcontainer/devcontainer.json | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..b5ad7f8c7d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet +{ + "name": "C# (.NET)", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/dotnet:1-6.0", + "features": { + "ghcr.io/devcontainers/features/dotnet:2": {} + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [5000, 5001], + // "portsAttributes": { + // "5001": { + // "protocol": "https" + // } + // } + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "dotnet restore", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} From 6915616c4d71b5f37af2dd901e3b4ddc631669ef Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 2 Apr 2024 12:35:40 -0700 Subject: [PATCH 2/5] change container --- .devcontainer/devcontainer.json | 39 +++++++++------------------------ 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b5ad7f8c7d..e43906a093 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,30 +1,11 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet { - "name": "C# (.NET)", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/dotnet:1-6.0", - "features": { - "ghcr.io/devcontainers/features/dotnet:2": {} - } - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [5000, 5001], - // "portsAttributes": { - // "5001": { - // "protocol": "https" - // } - // } - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "dotnet restore", - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} + "name": ".NET 8 with 6", + "image": "mcr.microsoft.com/dotnet/sdk:8.0", + "features": { + "ghcr.io/devcontainers/features/dotnet:2": { + "version": "none", + "dotnetRuntimeVersions": "6.0", + "aspNetCoreRuntimeVersions": "6.0" + } + } +} \ No newline at end of file From 28c089821f08ab32edaaa58e4d0072079dcec34f Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 2 Apr 2024 13:30:58 -0700 Subject: [PATCH 3/5] add ms-dotnettools.csdevkit extension so it is pre-installed --- .devcontainer/devcontainer.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e43906a093..fda1ea57d3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": ".NET 8 with 6", + "name": ".NET 8 with .NET 6", "image": "mcr.microsoft.com/dotnet/sdk:8.0", "features": { "ghcr.io/devcontainers/features/dotnet:2": { @@ -7,5 +7,10 @@ "dotnetRuntimeVersions": "6.0", "aspNetCoreRuntimeVersions": "6.0" } - } + }, + "customizations": { + "vscode": { + "extensions": ["ms-dotnettools.csdevkit"] + } + } } \ No newline at end of file From fdb1083dd74493f05e3ccd3d9d4accdddc59ad8a Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 2 Apr 2024 13:36:59 -0700 Subject: [PATCH 4/5] add .net6 sdk --- .devcontainer/devcontainer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fda1ea57d3..8a46b26d8d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,10 +2,12 @@ "name": ".NET 8 with .NET 6", "image": "mcr.microsoft.com/dotnet/sdk:8.0", "features": { + // https://github.com/devcontainers/features/tree/main/src/dotnet "ghcr.io/devcontainers/features/dotnet:2": { - "version": "none", + "version": "latest", "dotnetRuntimeVersions": "6.0", - "aspNetCoreRuntimeVersions": "6.0" + "aspNetCoreRuntimeVersions": "6.0", + "additionalVersions": "6.0" } }, "customizations": { From 6181b8c272fffad15d96b5e8dff2f784b830fa36 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Mon, 22 Apr 2024 09:54:05 -0700 Subject: [PATCH 5/5] update remoteEnv with dotnet tools to path and added comments to clarify usage of properties. added new line at EOF. --- .devcontainer/devcontainer.json | 39 +++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8a46b26d8d..9f9995aa30 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,18 +1,23 @@ { - "name": ".NET 8 with .NET 6", - "image": "mcr.microsoft.com/dotnet/sdk:8.0", - "features": { - // https://github.com/devcontainers/features/tree/main/src/dotnet - "ghcr.io/devcontainers/features/dotnet:2": { - "version": "latest", - "dotnetRuntimeVersions": "6.0", - "aspNetCoreRuntimeVersions": "6.0", - "additionalVersions": "6.0" - } - }, - "customizations": { - "vscode": { - "extensions": ["ms-dotnettools.csdevkit"] - } - } -} \ No newline at end of file + "name": ".NET 8 with .NET 6", + "image": "mcr.microsoft.com/dotnet/sdk:8.0", + "features": { + // https://github.com/devcontainers/features/tree/main/src/dotnet + "ghcr.io/devcontainers/features/dotnet:2": { + "version": "latest", + "dotnetRuntimeVersions": "6.0", + "aspNetCoreRuntimeVersions": "6.0", + "additionalVersions": "6.0" + } + }, + "customizations": { + "vscode": { + "extensions": [ "ms-dotnettools.csdevkit" ] + } + }, + "remoteEnv": { + // https://docs.github.com/en/codespaces/developing-in-a-codespace/persisting-environment-variables-and-temporary-files#for-all-codespaces-for-a-repository + // Set .NET tools directory to PATH since not automatically done by SDK image. + "PATH": "${containerEnv:PATH}:/root/.dotnet/tools" + } +}