.NET Framework 4.8 Container Improvements (November 2021 Update, KB9008392) #935
richlander
announced in
Announcements
Replies: 1 comment
-
This issue for .NET 6+ is related: dotnet/runtime#53149 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
.NET Framework 4.8 Container Improvements (November 2021 Update, KB9008392)
.NET Framework 4.8 has been updated to better support containers with the November 2021 update. With .NET 6 releasing, we backported all of the .NET 6 container functionality to .NET Framework 4.8. The goal of these changes is to enable .NET Framework 4.8 applications to work well in Azure Kubernetes Service (AKS).
.NET Framework 4.8 now has the following capabilities:
Environment.ProcessorCount
valueFor the .NET Framework implementation, environment variables continue to use the
COMPLUS_
notDOTNET_
format.This update only affects .NET Framework 4.8 container images and is applied via the KB9008392 patch. There are no plans to backport these changes to earlier .NET Framework versions. The changes are not delivered via Windows Update to Windows Server or Windows client machines. The changes will be deployed to .NET Framework 4.8 more generally at a later date.
You can test these changes with with our sample apps on MCR. You may find it easier to build and test our samples directly, as is demonstrated below.
Process-isolated containers
The biggest change is support for process-isolated containers. This same change was added to .NET 6.
From the .NET 6 post:
Example console app usage
The following example uses a sample console app to demonstrate the new process-isolated container image support.
This scenario only works well/reliably if your Windows host and container guest match. As a result, the sample app was built with a special technique. The primary issue is that the sample depends on a multi-arch tag.
Building the image:
Note: The commands above are oriented on Windows 11. If you are using Windows 10 or Windows Server 2019, then switch the
ltsc2022
tags toltsc2019
.Launching the container:
The first container launch is unconstrained, and the following two launches constrain the container in various ways.
Example ASP.NET app usage
The following example uses a sample ASP.NET app to demonstrate the new process-isolated container image support.
The same model is used as is used earlier.
Note: The commands above are oriented on Windows 11. If you are using Windows 10 or Windows Server 2019, then switch the
ltsc2022
tags toltsc2019
.Launching the container unconstrained:
Launching the container constrained to 1 core:
Beta Was this translation helpful? Give feedback.
All reactions