devcontainers / templates

Repository for Dev Container Templates that are managed by Dev Container spec maintainers. See https://github.com/devcontainers/template-starter to create your own!
https://containers.dev/templates
MIT License
924 stars 242 forks source link

Ensure .NET dev container resources work well with latest C# Dev Kit #164

Closed bamurtaugh closed 1 year ago

bamurtaugh commented 1 year ago

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:

bamurtaugh commented 1 year ago

Current template flow

Creating dev container

Using dev container template

Takeaway

Current Feature flow

Creating dev container

Using dev container with .NET Feature

Takeaway

Next steps

timheuer commented 1 year ago
  • 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.

bamurtaugh commented 1 year ago

@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!

bamurtaugh commented 1 year ago

PRs opened:

Edit: Closing the above as this probably isn't ideal as it may introduce breakages.

bamurtaugh commented 1 year ago

@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.

timheuer commented 1 year ago

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

bamurtaugh commented 1 year ago

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.

Juancanico5 commented 1 year ago

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

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

Takeaway

Next steps

bamurtaugh commented 1 year ago

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.