Skip to content

Instantly share code, notes, and snippets.

@ebicoglu
Last active September 17, 2021 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebicoglu/cd246842c91f32ce378f7a104482a9fb to your computer and use it in GitHub Desktop.
Save ebicoglu/cd246842c91f32ce378f7a104482a9fb to your computer and use it in GitHub Desktop.
Upgrade from .NET5 to .NET6

Upgrade to .NET6-rc.1

1- Install the new .NET SDK to your development computer. 2- Install the new .NET Runtime to your production server. 3- Update Dockerfile in each website.

Remove:

FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base

Add:

FROM mcr.microsoft.com/dotnet/aspnet:6.0.0-rc.1-bullseye-slim  AS base

How to install .NET SDK 6 preview to Ubuntu

  1. mkdir $HOME/dotnet_install && cd $HOME/dotnet_install
  2. Run curl -L https://aka.ms/install-dotnet-preview -o install-dotnet-preview.sh
  3. Run the script with sudo bash install-dotnet-preview.sh

mkdir -p $HOME/dotnet && tar zxf dotnet.tar.gz -C $HOME/dotnet
export PATH=$PATH:$HOME/dotnet

sudo dpkg -i dotnet-host-6.0.0-rc.1.21451.13-x64.deb 
sudo dpkg -i dotnet-hostfxr-6.0.0-rc.1.21451.13-x64.deb 
sudo dpkg -i dotnet-runtime-6.0.0-rc.1.21451.13-x64.deb
sudo dpkg -i aspnetcore-runtime-6.0.0-rc.1.21452.15-x64.deb     
sudo dpkg -i aspnetcore-targeting-pack-6.0.0-rc.1.21452.15.deb  
sudo dpkg -i dotnet-apphost-pack-6.0.0-rc.1.21451.13-x64.deb    
sudo dpkg -i dotnet-runtime-deps-6.0.0-rc.1.21451.13-x64.deb
sudo dpkg -i dotnet-targeting-pack-6.0.0-rc.1.21451.13-x64.deb
sudo dpkg -i netstandard-targeting-pack-2.1_2.1.0-1_amd64.deb
sudo dpkg -i dotnet-sdk-6.0.100-rc.1.21458.32-x64.deb

Check the dotnet version with the following command:

dotnet --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment