Skip to content

Commit c23abd6

Browse files
authored
Use Microsoft.NETCore.App.Ref version in place of legacy MicrosoftNETCoreAppPackageVersion (#61860)
* Use Microsoft.NETCore.App.Ref version in place of legacy MicrosoftNETCoreAppPackageVersion https://github.com/dotnet/dotnet/blob/main/repo-projects/Directory.Build.props#L247-L251 The reason for this block is that repos tend to use arch specific version properties as proxy version numbers. So aspnetcore will set the runtime pack version based on the MicrosoftNETCoreAppVersion, which it typically sets based on the x64 runtime pack version. But since that's not produced in an x86 build, we jump some through VMR hoops to get this right. The stabilized build exposes a few of these cases where we incorrectly use a few properties, which is quite fixable, but overall this block caught my attention and I think we should remove it. aspnetcore seems to be the biggest user of MicrosoftNETCoreAppVersion, set to the x64 runtime pack version. I was thinking to just changing all the uses to the ref pack version, since the runtime pack and ref pack versions are always aligned. We can then get rid of this block altogether, which would be great * Remove unneeded content property
1 parent c3fb958 commit c23abd6

File tree

18 files changed

+58
-69
lines changed

18 files changed

+58
-69
lines changed

eng/Dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ and are generated based on the last package release.
253253
-->
254254
<LatestPackageReference Update="@(LatestPackageReference->WithMetadataValue('Version', ''))">
255255
<Version
256-
Condition=" $([System.String]::new('%(Identity)').StartsWith('Microsoft.NETCore.App.Runtime.')) or $([System.String]::new('%(Identity)').StartsWith('Microsoft.NETCore.App.Crossgen2.'))">$(MicrosoftNETCoreAppRuntimeVersion)</Version>
256+
Condition=" $([System.String]::new('%(Identity)').StartsWith('Microsoft.NETCore.App.Runtime.')) or $([System.String]::new('%(Identity)').StartsWith('Microsoft.NETCore.App.Crossgen2.'))">$(MicrosoftNETCoreAppRefVersion)</Version>
257257
</LatestPackageReference>
258258
</ItemGroup>
259259
</Project>

eng/Versions.props

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,6 @@
189189
190190
Versions below this comment are not managed by automation and can be changed as needed.
191191
-->
192-
<PropertyGroup Label="Dependency version settings">
193-
<!--
194-
Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
195-
All Runtime.$rid packages should have the same version.
196-
-->
197-
<MicrosoftNETCoreAppRuntimeVersion>$(MicrosoftNETCoreAppRuntimewinx64Version)</MicrosoftNETCoreAppRuntimeVersion>
198-
</PropertyGroup>
199192
<PropertyGroup Label="Manual">
200193
<!-- Dependencies from maintenance-packages -->
201194
<MicrosoftBCLHashCodeVersion>6.0.0</MicrosoftBCLHashCodeVersion>

eng/testing/linker/SupportFiles/Directory.Build.targets

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
<!-- needed to reference a specific version of NetCoreApp. Workaround https://github.com/dotnet/runtime/issues/81382 -->
99
<ItemGroup>
1010
<FrameworkReference Update="Microsoft.NETCore.App"
11-
RuntimeFrameworkVersion="$(MicrosoftNETCoreAppRuntimeVersion)" />
11+
RuntimeFrameworkVersion="$(MicrosoftNETCoreAppRefVersion)" />
1212

1313
<PackageReference Include="Microsoft.DotNet.ILCompiler"
14-
Version="$(MicrosoftNETCoreAppRuntimeVersion)" />
14+
Version="$(MicrosoftNETCoreAppRefVersion)" />
1515

1616
<!-- Workaround when there is no vNext SDK available; copy known packs info from 9.0. -->
1717
<KnownAppHostPack Include="@(KnownAppHostPack->WithMetadataValue('TargetFramework', 'net9.0'))"
@@ -37,7 +37,7 @@
3737

3838
<KnownFrameworkReference Update="Microsoft.NETCore.App">
3939
<LatestRuntimeFrameworkVersion
40-
Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRuntimeVersion)</LatestRuntimeFrameworkVersion>
40+
Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRefVersion)</LatestRuntimeFrameworkVersion>
4141
<TargetingPackVersion
4242
Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRefVersion)</TargetingPackVersion>
4343
<!--
@@ -48,19 +48,19 @@
4848
e.g. tool projects (again, property not set) use latest.
4949
-->
5050
<DefaultRuntimeFrameworkVersion Condition=" '$(IsServicingBuild)' != 'true' AND
51-
'%(TargetFramework)' == '$(TargetFramework)'">$(MicrosoftNETCoreAppRuntimeVersion)</DefaultRuntimeFrameworkVersion>
51+
'%(TargetFramework)' == '$(TargetFramework)'">$(MicrosoftNETCoreAppRefVersion)</DefaultRuntimeFrameworkVersion>
5252
<RuntimePackRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
5353
</KnownFrameworkReference>
5454

5555
<KnownAppHostPack Update="Microsoft.NETCore.App">
5656
<AppHostPackVersion
57-
Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRuntimeVersion)</AppHostPackVersion>
57+
Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRefVersion)</AppHostPackVersion>
5858
<AppHostRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
5959
</KnownAppHostPack>
6060

6161
<KnownRuntimePack Update="Microsoft.NETCore.App">
6262
<LatestRuntimeFrameworkVersion
63-
Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRuntimeVersion)</LatestRuntimeFrameworkVersion>
63+
Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRefVersion)</LatestRuntimeFrameworkVersion>
6464
<AppHostRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
6565
</KnownRuntimePack>
6666

eng/testing/linker/project.csproj.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<OutputType>Exe</OutputType>
66
<RuntimeIdentifier>{RuntimeIdentifier}</RuntimeIdentifier>
77
<PublishAot>{PublishAot}</PublishAot>
8-
<MicrosoftNETCoreAppRuntimeVersion>{MicrosoftNETCoreAppRuntimeVersion}</MicrosoftNETCoreAppRuntimeVersion>
98
<MicrosoftNETCoreAppRefVersion>{MicrosoftNETCoreAppRefVersion}</MicrosoftNETCoreAppRefVersion>
109
<RepoRoot>{RepoRoot}</RepoRoot>
1110
<!-- This warning code is no longer generated by new ILLinker, but the repo still uses the old ILLinker so we need to suppress temporarily -->

eng/testing/linker/trimmingTests.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
.Replace('{TargetFramework}', '%(TestConsoleApps.TargetFramework)')
8585
.Replace('{RuntimeIdentifier}','%(TestConsoleApps.TestRuntimeIdentifier)')
8686
.Replace('{PublishAot}','$(IsNativeAotTestProject)')
87-
.Replace('{MicrosoftNETCoreAppRuntimeVersion}','$(MicrosoftNETCoreAppRuntimeVersion)')
8887
.Replace('{MicrosoftNETCoreAppRefVersion}','$(MicrosoftNETCoreAppRefVersion)')
8988
.Replace('{RepoRoot}', '$(RepoRoot)')
9089
.Replace('{ExtraTrimmerArgs}', '%(TestConsoleApps.ExtraTrimmerArgs)')

eng/tools/GenerateFiles/Directory.Build.targets.in

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@
5454
<FrameworkReference
5555
Update="Microsoft.NETCore.App"
5656
Condition=" (('$(ProjectTargetFrameworkIdentifier)' == '${DefaultNetCoreTargetFramework}') AND '${DefaultNetCoreTargetFramework}' == '$(ProjectTargetFrameworkVersion)') AND '$(TargetLatestDotNetRuntime)' != 'false' "
57-
RuntimeFrameworkVersion="${MicrosoftNETCoreAppRuntimeVersion}"
57+
RuntimeFrameworkVersion="${MicrosoftNETCoreAppRefVersion}"
5858
TargetingPackVersion="${MicrosoftNETCoreAppRefVersion}" />
5959

6060
<PackageReference Include="Microsoft.DotNet.ILCompiler"
6161
Condition=" '$(PublishAot)' == 'true' "
62-
Version="${MicrosoftNETCoreAppRuntimeVersion}" />
62+
Version="${MicrosoftNETCoreAppRefVersion}" />
6363
</ItemGroup>
6464

6565
<ItemGroup>
6666
<!-- Use the same NETCore shared framework as repo built against except when building product code in servicing. -->
6767
<!-- We cannot use live shims when building tool packs in VMR - only package for current arch is available. -->
6868
<KnownFrameworkReference Update="Microsoft.NETCore.App" Condition=" '$(DotNetBuild)' != 'true' OR '$(PackAsToolShimRuntimeIdentifiers)' == '' ">
6969
<LatestRuntimeFrameworkVersion
70-
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</LatestRuntimeFrameworkVersion>
70+
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion}</LatestRuntimeFrameworkVersion>
7171
<TargetingPackVersion
7272
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion}</TargetingPackVersion>
7373
<!--
@@ -80,26 +80,26 @@
8080
-->
8181
<DefaultRuntimeFrameworkVersion Condition=" '$(IsServicingBuild)' != 'true' AND
8282
'%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' AND
83-
'$(TargetLatestDotNetRuntime)' != 'false' ">${MicrosoftNETCoreAppRuntimeVersion}</DefaultRuntimeFrameworkVersion>
83+
'$(TargetLatestDotNetRuntime)' != 'false' ">${MicrosoftNETCoreAppRefVersion}</DefaultRuntimeFrameworkVersion>
8484
<RuntimePackRuntimeIdentifiers Condition="'$(DotNetBuild)' == 'true'">%(RuntimePackRuntimeIdentifiers);$(TargetRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
8585
</KnownFrameworkReference>
8686

8787
<!-- We cannot use live shims when building tool packs in VMR - only package for current arch is available. -->
8888
<KnownAppHostPack Update="Microsoft.NETCore.App" Condition=" '$(DotNetBuild)' != 'true' OR '$(PackAsToolShimRuntimeIdentifiers)' == '' ">
8989
<AppHostPackVersion
90-
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</AppHostPackVersion>
90+
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion}</AppHostPackVersion>
9191
<AppHostRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
9292
</KnownAppHostPack>
9393

9494
<KnownRuntimePack Update="Microsoft.NETCore.App">
9595
<LatestRuntimeFrameworkVersion
96-
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</LatestRuntimeFrameworkVersion>
96+
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion}</LatestRuntimeFrameworkVersion>
9797
<AppHostRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
9898
</KnownRuntimePack>
9999

100100
<KnownWebAssemblySdkPack Update="Microsoft.NET.Sdk.WebAssembly.Pack">
101101
<WebAssemblySdkPackVersion
102-
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</WebAssemblySdkPackVersion>
102+
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion}</WebAssemblySdkPackVersion>
103103
</KnownWebAssemblySdkPack>
104104

105105
<KnownAspNetCorePack Update="Microsoft.AspNetCore.App.Internal.Assets">
@@ -109,13 +109,13 @@
109109

110110
<KnownCrossgen2Pack Update="Microsoft.NETCore.App.Crossgen2">
111111
<Crossgen2PackVersion
112-
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</Crossgen2PackVersion>
112+
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion}</Crossgen2PackVersion>
113113
<Crossgen2RuntimeIdentifiers Condition="'$(DotNetBuild)' == 'true'">%(Crossgen2RuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier)</Crossgen2RuntimeIdentifiers>
114114
</KnownCrossgen2Pack>
115115

116116
<KnownILLinkPack Update="Microsoft.NET.ILLink.Tasks" Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">
117117
<ILLinkPackVersion
118-
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</ILLinkPackVersion>
118+
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion}</ILLinkPackVersion>
119119
</KnownILLinkPack>
120120

121121
<!-- Use the just-built ASP.NET Core shared framework if available except when building product code in servicing. -->

eng/tools/GenerateFiles/GenerateFiles.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
MicrosoftAspNetCoreAppRefVersion=$(TargetingPackVersion);
2424
MicrosoftAspNetCoreAppRuntimeVersion=$(SharedFxVersion);
2525
MicrosoftNETCoreAppRefVersion=$(MicrosoftNETCoreAppRefVersion);
26-
MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion);
2726
MicrosoftPlaywrightCLIVersion=$(MicrosoftPlaywrightCLIVersion);
2827
LibNetHostAppPackVersion=$(BundledNETCoreAppPackageVersion);
2928
SupportedRuntimeIdentifiers=$([MSBuild]::Escape($(SupportedRuntimeIdentifiers)));

src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.sfxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@
160160
'%(ReferencePath.NuGetSourceType)' == 'Package' " />
161161

162162
<!--
163-
Use NETCore.App version for Runtime references.
163+
Use NETCore.App.Ref version for Runtime references.
164164
This is the same as above except in "stabilized" version builds, where the transport package version
165165
would be a non-shipping unstablized version, but the NETCore.App version is the shipping version.
166166
-->
167-
<_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(FileName)|$(MicrosoftNETCoreAppRuntimeVersion)')"
167+
<_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(FileName)|$(MicrosoftNETCoreAppRefVersion)')"
168168
Condition="'%(ReferencePath.NuGetPackageId)' == 'Microsoft.Internal.Runtime.AspNetCore.Transport' AND
169169
'%(ReferencePath.NuGetSourceType)' == 'Package' " />
170170

src/Framework/App.Runtime/src/aspnetcore-base-runtime.proj

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

1414
<Target Name="WriteBaseRuntimeVersionFile" AfterTargets="Build">
1515
<WriteLinesToFile File="$(BaseRuntimeVersionFileOutputPath)"
16-
Lines="$(MicrosoftNETCoreAppRuntimeVersion)"
16+
Lines="$(MicrosoftNETCoreAppRefVersion)"
1717
Overwrite="true" />
1818
</Target>
1919
</Project>

src/Framework/App.Runtime/src/aspnetcore-runtime-composite.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
-->
2727
<PropertyGroup>
2828
<!-- Use the BrowserDebugHost as a sentinel for the nonshipping version for .NETCoreApp -->
29-
<DotNetRuntimeArchiveFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-$(TargetRuntimeIdentifier).$(ArchiveFormat)</DotNetRuntimeArchiveFileName>
30-
<DotNetRuntimeArchiveFileName Condition="'$(PgoInstrument)' == 'true'">dotnet-runtime-pgo-$(MicrosoftNETCoreAppRuntimeVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension)</DotNetRuntimeArchiveFileName>
29+
<DotNetRuntimeArchiveFileName>dotnet-runtime-$(MicrosoftNETCoreAppRefVersion)-$(TargetRuntimeIdentifier).$(ArchiveFormat)</DotNetRuntimeArchiveFileName>
30+
<DotNetRuntimeArchiveFileName Condition="'$(PgoInstrument)' == 'true'">dotnet-runtime-pgo-$(MicrosoftNETCoreAppRefVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension)</DotNetRuntimeArchiveFileName>
3131
<DotNetRuntimeDownloadPath>Runtime/$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)/$(DotNetRuntimeArchiveFileName)</DotNetRuntimeDownloadPath>
3232
<DotNetRuntimeArchive>$(BaseIntermediateOutputPath)$(DotNetRuntimeArchiveFileName)</DotNetRuntimeArchive>
3333
</PropertyGroup>

0 commit comments

Comments
 (0)