devcontainer.json 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
  2. // https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/dotnet
  3. {
  4. "name": "C# (.NET)",
  5. "build": {
  6. "dockerfile": "Dockerfile",
  7. "args": {
  8. // The VARIANT here must align with a dotnet container image that
  9. // is publicly available on https://mcr.microsoft.com/v2/vscode/devcontainers/dotnet/tags/list.
  10. // We'll default to `latest` as the default. Generally, the .NET version that is baked
  11. // into the image by default doesn't matter since we end up installing our own
  12. // local version and using that by default in the container environment.
  13. "VARIANT": "latest",
  14. // Options
  15. "INSTALL_NODE": "true",
  16. "NODE_VERSION": "lts/*"
  17. }
  18. },
  19. // Add the IDs of extensions you want installed when the container is created.
  20. "extensions": [
  21. "ms-dotnettools.csharp",
  22. "EditorConfig.EditorConfig",
  23. "k--kato.docomment",
  24. "dbaeumer.vscode-eslint"
  25. ],
  26. "settings": {
  27. // Loading projects on demand is better for larger codebases
  28. "omnisharp.enableMsBuildLoadProjectsOnDemand": true,
  29. "omnisharp.enableRoslynAnalyzers": true,
  30. "omnisharp.enableEditorConfigSupport": true,
  31. "omnisharp.enableImportCompletion": true,
  32. },
  33. // Use 'postCreateCommand' to run commands after the container is created.
  34. "onCreateCommand": "bash -i ${containerWorkspaceFolder}/.devcontainer/scripts/container-creation.sh",
  35. // Add the locally installed dotnet to the path to ensure that it is activated
  36. // This is needed so that things like the C# extension can resolve the correct SDK version
  37. "remoteEnv": {
  38. "PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}",
  39. "DOTNET_MULTILEVEL_LOOKUP": "0",
  40. "TARGET": "net8.0",
  41. "DOTNET_WATCH_SUPPRESS_LAUNCH_BROWSER": "true"
  42. },
  43. // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
  44. "remoteUser": "vscode"
  45. }