Skip to content

Remove net472 containers - #53547

Merged
dsplaisted merged 1 commit into
release/10.0.4xxfrom
dev/ykovalova/remove_net472_containers
Apr 27, 2026
Merged

Remove net472 containers#53547
dsplaisted merged 1 commit into
release/10.0.4xxfrom
dev/ykovalova/remove_net472_containers

Conversation

@YuliiaKovalova

@YuliiaKovalovaYuliiaKovalova commented Mar 20, 2026

Copy link
Copy Markdown
Member

Summary

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 this infrastructure is no longer needed.

Fixes

dotnet/msbuild#11333

@github-actionsgithub-actionsBot added the Area-Containers Related to dotnet SDK containers functionality label Mar 20, 2026
@YuliiaKovalova
YuliiaKovalova changed the base branch from main to release/10.0.3xxMarch 23, 2026 12:35
@YuliiaKovalovaYuliiaKovalova changed the title remove net472 containersRemove net472 containersMar 23, 2026
@YuliiaKovalova
YuliiaKovalova marked this pull request as ready for review March 23, 2026 17:14
@YuliiaKovalova
YuliiaKovalova requested a review from a team as a code ownerMarch 23, 2026 17:14
CopilotAI review requested due to automatic review settings March 23, 2026 17:14
@YuliiaKovalova

Copy link
Copy Markdown
MemberAuthor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) for Microsoft.NET.Build.Containers and related integration tests, removing net472-only source/test shims.
  • Remove net472 task publishing/packaging outputs (layout + nupkg content) and update package content expectations accordingly.
  • Update the shipped .props to 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
FileDescription
test/UnitTests.projStops including Containers integration tests in the TestFullMSBuild/net472 run.
test/Microsoft.NET.Build.Containers.IntegrationTests/PackageTests.csUpdates dependency and nupkg content assertions to remove tasks/net472 expectations.
test/Microsoft.NET.Build.Containers.IntegrationTests/Microsoft.NET.Build.Containers.IntegrationTests.csprojRemoves net472 target and related conditional compilation setup.
test/Microsoft.NET.Build.Containers.IntegrationTests/FullFramework/CreateNewImageToolTaskTests.csDeletes Full Framework–specific tests for the removed ToolTask-based implementation.
src/Layout/redist/targets/GenerateLayout.targetsRemoves publishing of net472 task assets into the redist layout.
src/Layout/redist/targets/Crossgen.targetsUpdates comment to reflect removal of net472 components.
src/Containers/packaging/package.csprojRemoves net472 packaging path and dependency harvesting for net472 tasks.
src/Containers/packaging/build/Microsoft.NET.Build.Containers.propsRemoves MSBuild runtime-based TFM selection; uses only net10.0 tasks and updates UsingTask declarations.
src/Containers/Microsoft.NET.Build.Containers/net472Definitions.csDeletes net472-only polyfills (IsExternalInit, NotNullWhenAttribute).
src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImageToolTask.csDeletes the net472 ToolTask-based shim implementation.
src/Containers/Microsoft.NET.Build.Containers/Tasks/ComputeDotnetBaseImageAndTag.csRemoves now-unused NETFRAMEWORK-only using directives.
src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net472/PublicAPI.Unshipped.txtRemoves net472 public API baseline.
src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net472/PublicAPI.Shipped.txtRemoves net472 public API baseline header.
src/Containers/Microsoft.NET.Build.Containers/Microsoft.NET.Build.Containers.csprojRemoves net472 TFM and all net472-specific compile/package reference conditionals.
src/Containers/Microsoft.NET.Build.Containers/ContainerHelpers.csRemoves NETFRAMEWORK/NET conditional usings now that net472 is gone.

Comment threadsrc/Containers/packaging/package.csproj Outdated
@baronfel

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
MemberAuthor

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.

@marcpopMSFT & @mmitche could you please check this comment? Do you have any concerns regarding removing this package from publishing?

@mmitche

Copy link
Copy Markdown
Member

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.

@marcpopMSFT & @mmitche could you please check this comment? Do you have any concerns regarding removing this package from publishing?

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

Copy link
Copy Markdown
MemberAuthor

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.

@marcpopMSFT & @mmitche could you please check this comment? Do you have any concerns regarding removing this package from publishing?

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.

Cool, thanks!
Done

<IsPackable>true</IsPackable>
<IsShipping>true</IsShipping>
<IsShipping>false</IsShipping>
<IsShippingPackage>true</IsShippingPackage>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmitche what's the difference/meaning of IsShipping vs IsShippingPackage? Are both needed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
MemberAuthor

hi @lbussell ,
Could you please review the changes?

@YuliiaKovalova

Copy link
Copy Markdown
MemberAuthor

hm , after pulling changes from the target branch the tests fail with
》C:\Program Files\Microsoft Visual Studio\18\Insiders\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1259,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.9 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [C:\h\w\AA3A097C\t\dotnetSdkTests\hepu34ny.vpu\MissingRefere---C53218B1\MissingReferenceAssemblies\MissingReferenceAssemblies.csproj]

https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-sdk-refs-pull-53547-merge-b36b34842dd1493ea8/Microsoft.NET.Build.Tests.dll.4/3/console.b0eae202.log?helixlogtype=result&skoid=8eda00af-b5ec-4be9-b69b-0919a2338892&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-08T19%3A03%3A13Z&ske=2026-04-08T20%3A03%3A13Z&sks=b&skv=2026-02-06&sv=2026-02-06&se=2026-04-08T20%3A03%3A13Z&sr=b&sp=rl&sig=CbfG9rtbvtmyEysehbVKmhPJ5ybf3254LrHiDuVGres%3D

@YuliiaKovalova

Copy link
Copy Markdown
MemberAuthor

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

Copy link
Copy Markdown
Contributor

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.

Hi @marcpopMSFT, @dsplaisted, could you please take a look?

@dsplaisted
dsplaisted enabled auto-merge April 22, 2026 15:04
@marcpopMSFT

Copy link
Copy Markdown
Member

@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.

@YuliiaKovalova
YuliiaKovalova changed the base branch from release/10.0.3xx to release/10.0.4xxApril 27, 2026 07:52
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
@YuliiaKovalova
YuliiaKovalovaforce-pushed the dev/ykovalova/remove_net472_containers branch from 783f873 to 8f77039CompareApril 27, 2026 08:08
@dsplaisted
dsplaisted merged commit 117fc71 into release/10.0.4xxApr 27, 2026
28 checks passed
@dsplaisted
dsplaisted deleted the dev/ykovalova/remove_net472_containers branch April 27, 2026 09:35
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-ContainersRelated to dotnet SDK containers functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@YuliiaKovalova@baronfel@mmitche@DonnaChen888@marcpopMSFT@mthalman@dsplaisted