While trying to start a service inside a Docker environment, this was not possible due to the wrong .NETCore version, as you can see in this excerpt from the Logs of my Docker container:

# cd 2022-11-24 12:01:46 It was not possible to find any compatible framework version
2022-11-24 12:01:46 The framework 'Microsoft.NETCore.App', version '6.0.0' was not found.
2022-11-24 12:01:46   - The following frameworks were found:
2022-11-24 12:01:46       5.0.17 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
2022-11-24 12:01:46 
2022-11-24 12:01:46 You can resolve the problem by installing the specified framework and/or SDK.
2022-11-24 12:01:46 
2022-11-24 12:01:46 The specified framework can be found at:
2022-11-24 12:01:46   - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=debian.10-x64

This analysis is correct, as you can see here:

# cd /usr/share/dotnet/shared/Microsoft.NETCore.App
# ls -ltra
total 20
drwxrwxr-x 2 root root 12288 Apr 14  2022 5.0.17
drwxrwxr-x 3 root root  4096 Apr 14  2022 .
drwxrwxr-x 1 root root  4096 May 28 08:31 ..

=> no version 6.0.0

I imagine I could use an apt related commandline in order to get this fixed, but this would mean that I need to do this every time I start up my service again, which obviously I don't want.

How can I configure my Docker environment in such a way that it includes version 6.0.0 of Microsoft.NETCore.App?

My computer, on which Docker is running, is a Windows-10 one. The Docker containers are all Linux containers:

uname -a
Linux c91f4dccfd60 
  #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 GNU/Linux

The project itself is a C# one, the *.csproj projectfile contains the following entry:


-> so why install .Net framework 5.0.17?

Thanks in advance


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy