Skip to content

Commit 4a4afde

Browse files
committed
Pin MSBuild references to a lower version
Always referencing the latest MSBuild means that some things like the SDK resolver would be forced to target MSBuild's latest runtime, and that would break compat with uses. For instance, VSMac is currently on .NET 6.0 and can't run a net7.0 resolver. We do, however, want to always _ship_ the latest MSBuild.
1 parent 8f40238 commit 4a4afde

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

eng/Versions.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,12 @@
107107
<PropertyGroup>
108108
<!-- Dependencies from https://github.com/Microsoft/msbuild -->
109109
<MicrosoftBuildPackageVersion>17.4.0-preview-22469-04</MicrosoftBuildPackageVersion>
110-
<!-- .NET Framework-targeted tasks will need to run in an MSBuild that is older than the very latest,
110+
<MicrosoftBuildCurrentPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildCurrentPackageVersion>
111+
<!-- Some tasks and the resolver will need to run in an MSBuild that is older than the very latest,
111112
so target one that matches the version in minimumMSBuildVersion.
112113
113114
This avoids the need to juggle references to packages that have been updated in newer MSBuild. -->
114-
<MicrosoftBuildPackageVersion Condition=" '$([MSBuild]::GetTargetFrameworkIdentifier($(TargetFramework)))' == '.NETFramework' and exists('$(RepoRoot)\src\Layout\redist\minimumMSBuildVersion')">$([System.IO.File]::ReadAllText('$(RepoRoot)\src\Layout\redist\minimumMSBuildVersion').Trim())</MicrosoftBuildPackageVersion>
115+
<MicrosoftBuildPackageVersion Condition="exists('$(RepoRoot)\src\Layout\redist\minimumMSBuildVersion')">$([System.IO.File]::ReadAllText('$(RepoRoot)\src\Layout\redist\minimumMSBuildVersion').Trim())</MicrosoftBuildPackageVersion>
115116
<MicrosoftBuildFrameworkPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildFrameworkPackageVersion>
116117
<MicrosoftBuildRuntimePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildRuntimePackageVersion>
117118
<MicrosoftBuildLocalizationPackageVersion>17.4.0-preview-22469-04</MicrosoftBuildLocalizationPackageVersion>

src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<Target Name="VerifyMSBuildDependency" BeforeTargets="ResolveAssemblyReferences" Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TargetFramework)))' == '.NETCoreApp'">
2424
<PropertyGroup>
25-
<MSBuildPathInPackage>$(PkgMicrosoft_Build_Runtime)\contentFiles\any\net7.0\MSBuild.dll</MSBuildPathInPackage>
25+
<MSBuildPathInPackage>$(PkgMicrosoft_Build_Runtime)\contentFiles\any\net6.0\MSBuild.dll</MSBuildPathInPackage>
2626
</PropertyGroup>
2727
<Error Condition="!Exists('$(MSBuildPathInPackage)')" Text="Something moved around in Microsoft.Build.Runtime, adjust code here accordingly." />
2828
<ItemGroup>

src/Layout/tool_msbuild/tool_msbuild.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Build.Runtime" Version="$(MicrosoftBuildRuntimePackageVersion)" />
10+
<PackageReference Include="Microsoft.Build.Runtime" Version="$(MicrosoftBuildRuntimeCurrentPackageVersion)" />
1111
<PackageReference Include="Microsoft.Build.Localization" Version="$(MicrosoftBuildLocalizationPackageVersion)" />
1212
<PackageReference Include="System.Resources.Extensions" Version="$(SystemResourcesExtensionsPackageVersion)" />
1313
</ItemGroup>

0 commit comments

Comments
 (0)