Update dotnet version

Hi there,

currently we are working on an avalonia project with the avalonia template.
we consider upating to net 7 (or soon 8) since the performance improvements are great. but i dont get how i would update the container of the template correctly. there is the references dotnet-debug container that ships a net6 runtime. how would i be able to update that to 7 or 8 later?

best regards
dominik

1 Like

Greetings @tisis2,

Currently our dotnet containers just install what the marked LTS release is for dotnet. Which at the time of writing is dotnet 6. If you want to use some alternative version you’d have to modify your template to use this.

Looking at the default Avalonia template here: https://github.com/toradex/vscode-torizon-templates/blob/bookworm/dotnetAvalonia/Dockerfile

You’d need to change this container image that we use for the dotnet build-time:

# BUILD ------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS Build

This container comes from Microsoft they probably have one for 7.0, but you may need to check.

Then for actual runtime as you stated you’d need to change this container image:

# DOTNET -----------------------------------------------------------------------
FROM --platform=linux/${IMAGE_ARCH} \
    torizon/dotnet:${DOTNET_BASE_VERSION} AS Dotnet

Now this comes from us. The source of this container image can be found here: https://github.com/toradex/torizon-containers/tree/bookworm/debian-dotnet-development-images

That said you could try to create your own container image that has another dotnet version installed. Then substitute your custom dotnet container into the template Dockerfile.

Of course I can’t guarantee any of this will work with the alternate dotnet versions. But it’s something you can give a try.

Best Regards,
Jeremias

hi, thanks for your answer.
so that means very soonish there will be dotnet 8 container from your side, since it is the next LTS an released in a few weeks?

best regards
Dominik

so that means very soonish there will be dotnet 8 container from your side, since it is the next LTS an released in a few weeks?

Well in theory, though I imagine it won’t be an instantaneous transition. Also we haven’t had any discussions yet regarding .NET 8 so there may still need to be some internal discussions on our side. Anyways .NET 6 is still supported for another year to allow transition so it’s not like we drop it immediately.

That said if you see the Dockerfile for our dotnet containers: https://github.com/toradex/torizon-containers/blob/bookworm/debian-dotnet-development-images/base/Dockerfile

We literally just use the standard install method with the dotnet-install.sh script. We just specify the “latest” version, which by the script’s definition defaults to the latest LTS. I’m not sure once .NET 8 is released whether this script will then point to .NET 8 right away or not.

Best Regards,
Jeremias