Closed bamurtaugh closed 1 year ago
Upgrade
to use C# pre-release extension, extension installs and dev container rebuilds
@prerelease
Get Started with C# Dev Kit
walkthrough
F5
; Run and Debug view works if I switch to Debug Console
Test: Run All Tests
latest
dotnet --version
doesn't work
@prerelease
, as described in this issue)
- Can we install pre-release version of C# extension in dev container?
If you can figure out a way for us to do this, it would be huge. We're trying to get out of pre-release state for v2 as fast as possible, but have some compat things to work through. But if there is a way in devcontainer or other means to declare that to install (without a custom container) that'd be amazing.
@timheuer thanks for the context. @chrmarti shared that we can append @prerelease
after the extension name in devcontainer.json - I just tried it out, and it worked!
Based on the investigation I documented above, we have 2 main next steps to optimize our resources for the C# Dev Kit:
@timheuer I'm going to tag you in the 2 PRs I open, which will also be great spots where you can share if there are other issues you've experienced with any of these resources or other ideas for enhancements. Thanks for your help and insights!
PRs opened:
Edit: Closing the above as this probably isn't ideal as it may introduce breakages.
@timheuer the main changes seem to be using the pre-release version of the C# extension and fixing the .NET SDK installation issue in the .NET Feature.
Considering we want to avoid potential breakage that could be caused by using the pre-release C# extension in the official spec-hosted resources, were there other changes your team identified that we should consider for our resources? Please just let me know, happy to discuss further!
One idea is for the .NET team to host a C# Dev Kit template somewhere in the .NET GitHub org, which would allow for further / more experimental customization (i.e. pre-release version of the C# extension, include the C# Dev Kit extension directly, other Features or settings you think are useful in this development flow). If this is something you'd be interested in, we have a guide here, and I'd be happy to chat through any questions through the process.
One idea is for the .NET team to host a C# Dev Kit template somewhere in the .NET GitHub org
I thought about this and just enabling it also as a feature. However given I now know of this little @prerelease
trick ;-) -- I think just sharing a snippet is actually the simplest way for now...example: https://gist.github.com/timheuer/694f8a3ef565b1cb5fbe616c9a1e18cc
Great, totally makes sense!
I'll leave this issue open for a bit until https://github.com/devcontainers/features/issues/560 is complete and in case folks have further ideas in the coming days.
Flujo de plantilla actual
Creando un contenedor de desarrollo
- Empezar con carpeta vacía
- Ejecute el comando "Dev Containers: New Dev Container"
- Elija la plantilla .NET, la última imagen .NET (7.0)
- Construir contenedor
Uso de la plantilla de contenedor de desarrollo
- Instale el kit de desarrollo de C#
En el contenedor, ejecute: ".NET: Nuevo proyecto", elija Aplicación de consola
- Obtenga 2 errores y 1 inicio de sesión brindis:
Select
Upgrade
to use C# pre-release extension, extension installs and dev container rebuilds
- Change to make: Install pre-release version of C# extension in dev container: Use
@prerelease
- Try ".NET: New Project" again, now I get quick pick of options
- Select Console App
Not sure what to do next, so I open the
Get Started with C# Dev Kit
walkthrough
- Issue, now resolved: Ran into All walkthroughs don't show immediately from "Welcome: Open Walkthrough" microsoft/vscode#184960
Sign in
- Issue, now resolved: [BUG] Stuck signing in microsoft/vscode-dotnettools#124
Don't see new solution explorer
Can run app with
F5
; Run and Debug view works if I switch to Debug Console
- Issue, now resolved: [BUG] Improve C# Dev Kit Debugging Walkthrough microsoft/vscode-dotnettools#130
Wasn't sure how to run tests, eventually got there through command
Test: Run All Tests
Takeaway
- Switch to pre-release version of C# extension in image
- Miscellaneous other issues, not necessarily dev container specific
Current Feature flow
Creating dev container
- Start with empty folder
- Run command "Dev Containers: New Dev Container"
- Choose Ubuntu template
- Add .NET CLI Feature, version
latest
- Build container
Using dev container with .NET Feature
- Switch to pre-release of C# extension, reload
- Install C# Dev Kit extension
- In container, run: ".NET: New Project", choose Console App
Get below error, and
dotnet --version
doesn't work
- Seems to be this issue: dotnet feature fails to install on ubuntu:jammy features#560, with workaround in this comment
Takeaway
- Switch to pre-release version of C# extension in Feature
- Team is working on a fix for dotnet feature fails to install on ubuntu:jammy features#560 now since it seems this is more prevalent and not just a one-off
Next steps
- Open PRs for Feature and image to use pre-release version of C# extension (append
@prerelease
, as described in this issue)- Work on fix for dotnet feature fails to install on ubuntu:jammy features#560
- Discuss with .NET team experts (like Tim) further to ensure changes look accurate to them too
Thanks again for the discussion here! I'll close out this issue, but please let me know if folks find other ways our .NET resources could even better work with the C# Dev Kit.
With the release of the C# Dev Kit, let's review the .NET Template (https://github.com/devcontainers/templates/tree/main/src/dotnet), Feature (https://github.com/devcontainers/features/tree/main/src/dotnet), and image (https://github.com/devcontainers/images/tree/main/src/dotnet).
Notes: