@@ -85,27 +85,23 @@ public static BuildScript WithDotNet(IAutobuilder<AutobuildOptionsShared> builde
8585 var installScript = DownloadDotNet ( builder , installDir , ensureDotNetAvailable ) ;
8686 return BuildScript . Bind ( installScript , installed =>
8787 {
88- Dictionary < string , string > ? env ;
88+ var env = new Dictionary < string , string >
89+ {
90+ { "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" , "true" } ,
91+ { "MSBUILDDISABLENODEREUSE" , "1" }
92+ } ;
8993 if ( installed == 0 )
9094 {
9195 // The installation succeeded, so use the newly installed .NET Core
9296 var path = builder . Actions . GetEnvironmentVariable ( "PATH" ) ;
9397 var delim = builder . Actions . IsWindows ( ) ? ";" : ":" ;
94- env = new Dictionary < string , string > {
95- { "DOTNET_MULTILEVEL_LOOKUP" , "false" } , // prevent look up of other .NET Core SDKs
96- { "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" , "true" } ,
97- { "MSBUILDDISABLENODEREUSE" , "1" } ,
98- { "PATH" , installDir + delim + path }
99- } ;
98+ env . Add ( "DOTNET_MULTILEVEL_LOOKUP" , "false" ) ; // prevent look up of other .NET Core SDKs
99+ env . Add ( "PATH" , installDir + delim + path ) ;
100100 }
101101 else
102102 {
103103 // The .NET SDK was not installed, either because the installation failed or because it was already installed.
104104 installDir = null ;
105- env = new Dictionary < string , string > {
106- { "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" , "true" } ,
107- { "MSBUILDDISABLENODEREUSE" , "1" }
108- } ;
109105 }
110106
111107 return f ( installDir , env ) ;
@@ -163,8 +159,7 @@ private static BuildScript DownloadDotNet(IAutobuilder<AutobuildOptionsShared> b
163159
164160 if ( ensureDotNetAvailable )
165161 {
166- const string latestDotNetSdkVersion = "8.0.101" ;
167- return DownloadDotNetVersion ( builder , installDir , latestDotNetSdkVersion , needExactVersion : false ) ;
162+ return DownloadDotNetVersion ( builder , installDir , Constants . LatestDotNetSdkVersion , needExactVersion : false ) ;
168163 }
169164
170165 return BuildScript . Failure ;
0 commit comments