Uh oh!
There was an error while loading. Please reload this page.
Remove net472 containers - #53547
Conversation
YuliiaKovalova
commented
Mar 23, 2026
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR removes the net472 target and associated packaging/test/layout infrastructure from the Containers SDK (Microsoft.NET.Build.Containers), aligning with the move away from Full Framework MSBuild for VS container operations.
Changes:
- Drop multi-targeting (
$(SdkTargetFramework);net472) forMicrosoft.NET.Build.Containersand related integration tests, removingnet472-only source/test shims. - Remove
net472task publishing/packaging outputs (layout + nupkg content) and update package content expectations accordingly. - Update the shipped
.propsto always point at the .NET (net10.0) task implementation.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/UnitTests.proj | Stops including Containers integration tests in the TestFullMSBuild/net472 run. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/PackageTests.cs | Updates dependency and nupkg content assertions to remove tasks/net472 expectations. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/Microsoft.NET.Build.Containers.IntegrationTests.csproj | Removes net472 target and related conditional compilation setup. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/FullFramework/CreateNewImageToolTaskTests.cs | Deletes Full Framework–specific tests for the removed ToolTask-based implementation. |
| src/Layout/redist/targets/GenerateLayout.targets | Removes publishing of net472 task assets into the redist layout. |
| src/Layout/redist/targets/Crossgen.targets | Updates comment to reflect removal of net472 components. |
| src/Containers/packaging/package.csproj | Removes net472 packaging path and dependency harvesting for net472 tasks. |
| src/Containers/packaging/build/Microsoft.NET.Build.Containers.props | Removes MSBuild runtime-based TFM selection; uses only net10.0 tasks and updates UsingTask declarations. |
| src/Containers/Microsoft.NET.Build.Containers/net472Definitions.cs | Deletes net472-only polyfills (IsExternalInit, NotNullWhenAttribute). |
| src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImageToolTask.cs | Deletes the net472 ToolTask-based shim implementation. |
| src/Containers/Microsoft.NET.Build.Containers/Tasks/ComputeDotnetBaseImageAndTag.cs | Removes now-unused NETFRAMEWORK-only using directives. |
| src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net472/PublicAPI.Unshipped.txt | Removes net472 public API baseline. |
| src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net472/PublicAPI.Shipped.txt | Removes net472 public API baseline header. |
| src/Containers/Microsoft.NET.Build.Containers/Microsoft.NET.Build.Containers.csproj | Removes net472 TFM and all net472-specific compile/package reference conditionals. |
| src/Containers/Microsoft.NET.Build.Containers/ContainerHelpers.cs | Removes NETFRAMEWORK/NET conditional usings now that net472 is gone. |
Uh oh!
There was an error while loading. Please reload this page.
baronfel
commented
Mar 24, 2026
This looks correct, however anyone still using the Microsoft.Net.Build.Containers NuGet package and using an older version of VS will be broken if they upgrade. We need to stop publishing the package now that it's baked into the SDK too. |
YuliiaKovalova
commented
Mar 24, 2026
@marcpopMSFT & @mmitche could you please check this comment? Do you have any concerns regarding removing this package from publishing? |
mmitche
commented
Mar 24, 2026
Only concern is that it shows up as a package ref somewhere we don't expect, but we should find that in testing. Mark the package as non-shipping and I think that should about do it. |
YuliiaKovalova
commented
Mar 25, 2026
Cool, thanks! |
| <IsPackable>true</IsPackable> | ||
| <IsShipping>true</IsShipping> | ||
| <IsShipping>false</IsShipping> | ||
| <IsShippingPackage>true</IsShippingPackage> |
There was a problem hiding this comment.
@mmitche what's the difference/meaning of IsShipping vs IsShippingPackage? Are both needed?
There was a problem hiding this comment.
IsShipping is broader than IsShippingPackage. IsShipping are used in projects where some assets produced are shipping while others are not: https://github.com/dotnet/arcade/blob/main/Documentation/ArcadeSdk.md#isshipping-isshippingassembly-isshippingpackage-isshippingvsix-bool
I would set IsShipping == false
YuliiaKovalova
commented
Apr 8, 2026
hi @lbussell , |
YuliiaKovalova
commented
Apr 8, 2026
hm , after pulling changes from the target branch the tests fail with |
Uh oh!
There was an error while loading. Please reload this page.
YuliiaKovalova
commented
Apr 22, 2026
HI @DonnaChen888 , The reported failures aren't related to my changes, I see the same in https://github.com/dotnet/sdk/runs/72391515947 could you please force-merge it? I have an approval from containers maintainer. |
DonnaChen888
commented
Apr 22, 2026
Hi @marcpopMSFT, @dsplaisted, could you please take a look? |
marcpopMSFT
commented
Apr 24, 2026
@YuliiaKovalova you use the /ba-g comment and provide a justification for why the build analysis check should be green. This PR though should target 4xx as 3xx is now locked down. |
Remove the net472 target from the Containers SDK (Microsoft.NET.Build.Containers), keeping only the .NET Core (SdkTargetFramework) target. The net472 build existed to support Visual Studio's Full-Framework MSBuild (MSBuildRuntimeType == Full). Now that VS uses .NET Runtime with HostObject support for container operations, the net472 target and all related infrastructure is no longer needed. Changes: - Remove net472 TFM from Microsoft.NET.Build.Containers.csproj - Delete CreateNewImageToolTask (ToolTask-based implementation) - Delete netframeworkDefinitions.cs (net472-only polyfills) - Remove ToolTask-related properties from targets/props - Remove net472 PublicAPI files - Delete FullFramework test suite (CreateNewImageToolTaskTests) - Exclude Containers from crossgenning in Crossgen.targets - Fix package.csproj: mark as non-shipping, update output paths Fixes: dotnet/msbuild#11333
783f873 to
8f77039CompareUh oh!
There was an error while loading. Please reload this page.
Summary
Remove the
net472target from the Containers SDK (Microsoft.NET.Build.Containers), keeping only the .NET Core ($(SdkTargetFramework)) target.The
net472build existed to support Visual Studio's Full-Framework MSBuild (MSBuildRuntimeType == Full). Now that VS uses .NET Runtime with HostObject support for container operations, thenet472target and all this infrastructure is no longer needed.Fixes
dotnet/msbuild#11333