-
-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Labels
Description
Overview of the issue
The blueprint generate a codebase using dotnet version 9, incompatible with the supported devcontainer dotnet version 7
Motivation for or Use Case
Use the devcontainer feature generated by default.
Reproduce the error
run the command
jhipster-dotnetcore
Suggest a Fix
A quick turn around is to update the devcontainer files. Below is what I am using:
the devcontainer configuration file:
// 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:0-7.0",
"build": {
"dockerfile": "./Dockerfile",
"context": ".."
},
"features": {
"ghcr.io/devcontainers/features/node:1": {}
},
// 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",
// 👇🏼 Trust the development certificates, run each time the
// container is successfully started
"postStartCommand": "dotnet dev-certs https --trust",
// Configure tool-specific properties.
"customizations": {
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp",
"ms-vscode-remote.remote-containers",
"ms-vscode-remote.vscode-remote-extensionpack",
"ms-dotnettools.dotnet-interactive-vscode",
]
}
}
// "remoteUser": "root",
// "mounts": [
// "source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
// "source=${localWorkspaceFolderBasename}-client-node_modules,target=${containerWorkspaceFolder}/src/DData/ClientApp//node_modules,type=volume",
// ],
// "postCreateCommand": "sudo chown node node_modules",
}
and a dockerfile as follow
# Use the most recent .NET LTS as the base image
FROM mcr.microsoft.com/devcontainers/dotnet:1-8.0
# Install the current .NET STS release on top of that
COPY --from=mcr.microsoft.com/dotnet/sdk:9.0 /usr/share/dotnet /usr/share/dotnet
# Finally install the most recent .NET 10.0 preview using the dotnet-install script
# COPY --from=mcr.microsoft.com/dotnet/nightly/sdk:10.0.100-preview.2 /usr/share/dotnet /usr/share/dotnet
JHipster Version(s)
- Jhipster 8.10
- Blueprint dotnetcore 4.5