@@ -85,6 +85,7 @@ public static async Task<int> Run(string testRoot,
8585 Cleaner cleaner = new Cleaner ( ) ;
8686
8787 DotNet dotnet = new DotNet ( ) ;
88+ Version runtimeVersion = dotnet . LatestRuntimeVersion ;
8889
8990 TestOutput defaultOutput = new TestOutputFormats . NewOutput ( ) ;
9091
@@ -101,19 +102,21 @@ public static async Task<int> Run(string testRoot,
101102 var sanitizer = new EnvironmentVariableSanitizer ( ) ;
102103 var envVars = sanitizer . SanitizeCurrentEnvironmentVariables ( ) ;
103104
104- var traits = CreateTraits ( dotnet . LatestRuntimeVersion , dotnet . LatestSdkVersion , platformIds , dotnet . IsMonoRuntime ( dotnet . LatestRuntimeVersion ) , trait ) ;
105+ var traits = CreateTraits ( runtimeVersion , dotnet . LatestSdkVersion , platformIds , dotnet . IsMonoRuntime ( runtimeVersion ) , trait ) ;
105106 Console . WriteLine ( $ "Tests matching these traits will be skipped: { string . Join ( ", " , traits . OrderBy ( s => s ) ) } .") ;
106107
108+ envVars [ "TestTargetFramework" ] = $ "net{ runtimeVersion . Major } .{ runtimeVersion . Minor } ";
109+
107110 SystemUnderTest system = new SystemUnderTest (
108111 dotnet ,
109- runtimeVersion : dotnet . LatestRuntimeVersion ,
112+ runtimeVersion : runtimeVersion ,
110113 sdkVersion : dotnet . LatestSdkVersion ,
111114 platformIds : platformIds ,
112115 environmentVariables : envVars ,
113116 traits : traits
114117 ) ;
115118
116- Version packageVersion = dotnet . LatestRuntimeVersion ;
119+ Version packageVersion = runtimeVersion ;
117120 string nuGetConfig = await GenerateNuGetConfigIfNeededAsync ( additionalFeed , packageVersion ,
118121 useSourceBuildNuGetConfig : false ) ;
119122 if ( verbose && nuGetConfig != null )
0 commit comments