Using C# dev kit in a devcontainer #111
Unanswered
ingentismg
asked this question in
Q&A
Replies: 2 comments 1 reply
-
If that is important: |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello Marcus 👋
Here's an example:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am currently trying to setup a devcontainer for use with an existing .dotnet 8 project and the VSCode C# dev kit extension. Sadly I am constantly running into problems.
My current setup is based on https://github.com/devcontainers/images/blob/main/src/dotnet/.devcontainer/:
Dockerfile
docker-compose.yaml excerpt (I know some things are not ideal but I have reworked a lot, some commands could now be included in the Dockerfile)
devcontainer.json
The problems that I have:
The example shown in https://github.com/devcontainers/images/blob/main/src/dotnet/.devcontainer/Dockerfile is adding
/home/vscode/.dotnet/tools
to thePATH
and I do not understand why. That folder does not exist.I know that I am installing a different extension,
ms-dotnettools.csdevkit
instead ofms-dotnettools.csharp
, but that should be installed automatically by the dev kit anyways. Even if I tryms-dotnettools.csharp
directly, that tools folder does not exist.Is that an outdated line or is something missing that should create this folder?
I want to use the
"remoteUser": "vscode"
option, as that will solve a lot of file permission problems. The problem is that the C# dev kit tries to rundotnet workload update
but can't:Inadequate permissions. Run the command with elevated privileges.
How can I run VSCode as the user and still have dotnet be able to update the workload? Is this connected to the missing tools in the user home?
Roughly half the time I start the container the C# dev kit extension will crash and I have to restart the container until it just works again. Is there something wrong with the devcontainer or the extension (in which case I will move this to the extension repository)?
Could you maybe add an additional dotnet example showing the usage of the C# dev kit with devcontainers?
Any help is appreciated. If some questions/problems are better suited as an issue in the vscode-dotnettools repo I will move there.
Thank you and best regards,
Marcus
Beta Was this translation helpful? Give feedback.
All reactions