|
158 | 158 | <PackageDownload Include="System.Numerics.Vectors" Version="[$(FrozenSystemNumericsVectorsVersion)]" /> |
159 | 159 | </ItemGroup> |
160 | 160 |
|
| 161 | + <!-- |
| 162 | + Select the dotnet/runtime build each project references. This selection lives here rather than in |
| 163 | + eng/Versions.props because it depends on $(IsUnitTestProject) and $(TargetFramework), which are |
| 164 | + not yet set when that file is imported. |
| 165 | +
|
| 166 | + Most projects reference $(RuntimePackageVersion_CompileTime) - the build MSBuild compiles against |
| 167 | + and declares as its own package dependencies. net472 unit-test projects load Microsoft.Build |
| 168 | + in-proc and run the redistributed MSBuild.exe, so they instead reference the servicing build the |
| 169 | + application projects redistribute (see $(DeployRuntimeServicingAssemblies) below): |
| 170 | + $(RuntimePackageVersion_VSDeploy). Referencing it flows the servicing versions through restore, |
| 171 | + keeping each test output directory self-consistent - the deployed assemblies, the generated |
| 172 | + test-host binding redirects, and the bundled MSBuild.exe.config all agree. net9.0 keeps the |
| 173 | + compile-time versions (the shared framework supplies these there). |
| 174 | +
|
| 175 | + Pinning only the leaf test projects higher does not cause an NU1109 downgrade, because their |
| 176 | + transitive providers (Microsoft.Build etc.) stay at $(RuntimePackageVersion_CompileTime). |
| 177 | + --> |
| 178 | + <PropertyGroup> |
| 179 | + <RuntimePackageVersion Condition="'$(IsUnitTestProject)' == 'true' and '$(TargetFramework)' == 'net472'">$(RuntimePackageVersion_VSDeploy)</RuntimePackageVersion> |
| 180 | + <RuntimePackageVersion Condition="'$(RuntimePackageVersion)' == ''">$(RuntimePackageVersion_CompileTime)</RuntimePackageVersion> |
| 181 | + |
| 182 | + <SystemCollectionsImmutableVersion>$(RuntimePackageVersion)</SystemCollectionsImmutableVersion> |
| 183 | + <SystemConfigurationConfigurationManagerVersion>$(RuntimePackageVersion)</SystemConfigurationConfigurationManagerVersion> |
| 184 | + <SystemDiagnosticsDiagnosticSourceVersion>$(RuntimePackageVersion)</SystemDiagnosticsDiagnosticSourceVersion> |
| 185 | + <SystemDiagnosticsEventLogVersion>$(RuntimePackageVersion)</SystemDiagnosticsEventLogVersion> |
| 186 | + <SystemFormatsAsn1Version>$(RuntimePackageVersion)</SystemFormatsAsn1Version> |
| 187 | + <SystemFormatsNrbfVersion>$(RuntimePackageVersion)</SystemFormatsNrbfVersion> |
| 188 | + <SystemReflectionMetadataVersion>$(RuntimePackageVersion)</SystemReflectionMetadataVersion> |
| 189 | + <SystemReflectionMetadataLoadContextVersion>$(RuntimePackageVersion)</SystemReflectionMetadataLoadContextVersion> |
| 190 | + <SystemResourcesExtensionsVersion>$(RuntimePackageVersion)</SystemResourcesExtensionsVersion> |
| 191 | + <SystemSecurityCryptographyProtectedDataVersion>$(RuntimePackageVersion)</SystemSecurityCryptographyProtectedDataVersion> |
| 192 | + <SystemTextEncodingCodePagesVersion>$(RuntimePackageVersion)</SystemTextEncodingCodePagesVersion> |
| 193 | + <SystemTextJsonVersion>$(RuntimePackageVersion)</SystemTextJsonVersion> |
| 194 | + <SystemThreadingChannelsVersion>$(RuntimePackageVersion)</SystemThreadingChannelsVersion> |
| 195 | + <SystemThreadingTasksDataflowVersion>$(RuntimePackageVersion)</SystemThreadingTasksDataflowVersion> |
| 196 | + </PropertyGroup> |
| 197 | + |
| 198 | + <!-- The net472 servicing wave binds to newer maintenance packages than the compile-time defaults in eng/Versions.props. --> |
| 199 | + <PropertyGroup Condition="'$(IsUnitTestProject)' == 'true' and '$(TargetFramework)' == 'net472'"> |
| 200 | + <SystemMemoryVersion>4.6.3</SystemMemoryVersion> |
| 201 | + <SystemThreadingTasksExtensionsVersion>4.6.3</SystemThreadingTasksExtensionsVersion> |
| 202 | + <SystemRuntimeCompilerServicesUnsafeVersion>6.1.2</SystemRuntimeCompilerServicesUnsafeVersion> |
| 203 | + </PropertyGroup> |
| 204 | + |
161 | 205 | <!-- Work around maintenance-packages updates breaking stuff --> |
162 | 206 | <Target Name="ReplaceCompileReferencesWithOlderMaintenancePackagesVersions" |
163 | 207 | BeforeTargets="ResolveAssemblyReferences" |
|
0 commit comments