Skip to content

Commit 10993e6

Browse files
ViktorHoferCopilot
andauthored
Don't import BundledVersions multiple times (#52774)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e11e478 commit 10993e6

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Layout/redist/targets/GenerateBundledVersions.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ Copyright (c) .NET Foundation. All rights reserved.
601601
602602
<PropertyGroup>
603603
<NetCoreRoot Condition="'%24(NetCoreRoot)' == ''">%24([MSBuild]::NormalizePath('%24(MSBuildThisFileDirectory)..\..\'))</NetCoreRoot>
604-
<NetCoreSdkRoot Condition="'%24(NetCoreSdkRoot)' == ''">%24(MSBuildThisFileDirectory)</NetCoreSdkRoot>
604+
<NetCoreSdkRoot>%24(MSBuildThisFileDirectory)</NetCoreSdkRoot>
605605
<NetCoreTargetingPackRoot Condition="'%24(NetCoreTargetingPackRoot)' == ''">%24([MSBuild]::EnsureTrailingSlash('%24(NetCoreRoot)'))packs</NetCoreTargetingPackRoot>
606606
<PrunePackageDataRoot Condition="'%24(PrunePackageDataRoot)' == ''">%24([MSBuild]::EnsureTrailingSlash('%24(MSBuildThisFileDirectory)'))PrunePackageData</PrunePackageDataRoot>
607607

src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.BundledVersions.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Copyright (c) .NET Foundation. All rights reserved.
1616
<PropertyGroup Condition="'$(NETCoreSdkBundledVersionsProps)' == ''">
1717
<NETCoreSdkBundledVersionsProps>$(MSBuildThisFileDirectory)..\..\..\Microsoft.NETCoreSdk.BundledVersions.props</NETCoreSdkBundledVersionsProps>
1818
</PropertyGroup>
19-
<Import Project="$(NETCoreSdkBundledVersionsProps)" Condition="Exists('$(NETCoreSdkBundledVersionsProps)')" />
19+
20+
<Import Project="$(NETCoreSdkBundledVersionsProps)" Condition="'$(NetCoreSdkRoot)' == '' and Exists('$(NETCoreSdkBundledVersionsProps)')" />
2021

2122
</Project>

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Copyright (c) .NET Foundation. All rights reserved.
1515
<NETCoreSdkBundledVersionsProps>$(MSBuildThisFileDirectory)..\..\..\Microsoft.NETCoreSdk.BundledVersions.props</NETCoreSdkBundledVersionsProps>
1616
</PropertyGroup>
1717

18-
<!-- Import bundled version information that needs to be availble before the Common.props / D.B.props import
18+
<!-- Import bundled version information that needs to be available before the Common.props / D.B.props import
1919
in order for users to be able to reference it. -->
20-
<Import Project="$(NETCoreSdkBundledVersionsProps)" Condition="Exists('$(NETCoreSdkBundledVersionsProps)')" />
20+
<Import Project="$(NETCoreSdkBundledVersionsProps)" Condition="'$(NetCoreSdkRoot)' == '' and Exists('$(NETCoreSdkBundledVersionsProps)')" />
2121

2222
</Project>

0 commit comments

Comments
 (0)