Skip to content

Conversation

@ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Feb 2, 2026

Avoids issues when the Sdk.BundledVersions.props file gets manually imported.

Copilot AI review requested due to automatic review settings February 2, 2026 16:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request prevents multiple imports of the Microsoft.NETCoreSdk.BundledVersions.props file by using NetCoreSdkRoot as a sentinel property to track whether the file has already been imported.

Changes:

  • Added '$(NetCoreSdkRoot)' == '' condition to Import statements in two files that import BundledVersions.props
  • Changed NetCoreSdkRoot property assignment in the generated BundledVersions.props from conditional to unconditional

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.props Added condition to prevent re-importing BundledVersions.props if already imported
src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.BundledVersions.props Added condition to prevent re-importing BundledVersions.props if already imported
src/Layout/redist/targets/GenerateBundledVersions.targets Changed NetCoreSdkRoot to always be set (removing conditional), ensuring it works as a reliable sentinel for import tracking

…BeforeCommon.props

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ViktorHofer ViktorHofer enabled auto-merge (squash) February 2, 2026 16:41
@ViktorHofer ViktorHofer merged commit 10993e6 into main Feb 2, 2026
24 of 26 checks passed
@ViktorHofer ViktorHofer deleted the AvoidImportingBundledVersionsMultipleTimes branch February 2, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants