@@ -178,13 +178,17 @@ def build_and_run(coreclr_args, output_mch_name):
178178 # Start with a "dotnet --info" to see what we've got.
179179 run_command ([dotnet_exe , "--info" ])
180180
181- env_copy = os .environ .copy ()
181+ tfm = "net9.0"
182+ os .environ ["PERFLAB_TARGET_FRAMEWORKS" ] = tfm
183+
184+ env_for_restore = os .environ .copy ()
185+
182186 if is_windows :
183187 # Try to work around problem with random NuGet failures in "dotnet restore":
184188 # error NU3037: Package 'System.Runtime 4.1.0' from source 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json':
185189 # The repository primary signature validity period has expired. [C:\h\w\A3B008C0\w\B581097F\u\performance\src\benchmarks\micro\MicroBenchmarks.csproj]
186190 # Using environment variable specified in https://github.com/NuGet/NuGet.Client/pull/4259.
187- env_copy ["NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY" ] = "9,2000"
191+ env_for_restore ["NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY" ] = "9,2000"
188192
189193 # If `dotnet restore` fails, retry.
190194 num_tries = 3
@@ -193,7 +197,7 @@ def build_and_run(coreclr_args, output_mch_name):
193197 exit_on_fail = try_num + 1 == num_tries
194198 (_ , _ , return_code ) = run_command (
195199 [dotnet_exe , "restore" , project_file , "--packages" , artifacts_packages_directory ],
196- _exit_on_fail = exit_on_fail , _env = env_copy )
200+ _exit_on_fail = exit_on_fail , _env = env_for_restore )
197201 if return_code == 0 :
198202 # It succeeded!
199203 break
@@ -203,7 +207,7 @@ def build_and_run(coreclr_args, output_mch_name):
203207
204208 run_command (
205209 [dotnet_exe , "build" , project_file , "--configuration" , "Release" ,
206- "--framework" , "net9.0" , "--no-restore" , "/p:NuGetPackageRoot=" + artifacts_packages_directory ,
210+ "--framework" , tfm , "--no-restore" , "/p:NuGetPackageRoot=" + artifacts_packages_directory ,
207211 "-o" , artifacts_directory ], _exit_on_fail = True )
208212
209213 # This is specifically for PowerShell.Benchmarks.
0 commit comments