@@ -73,14 +73,9 @@ public ProjectInfo CreateWasmTemplateProject(
7373 ( string projectName , string logPath , string nugetDir ) =
7474 InitProjectLocation ( idPrefix , config , aot , appendUnicodeToPath ?? s_buildEnv . IsRunningOnCI ) ;
7575
76- if ( addFrameworkArg ) {
77- var defaultTarget = template switch
78- {
79- Template . BlazorWasm => DefaultTargetFrameworkForBlazorTemplate ,
80- _ => DefaultTargetFramework ,
81- } ;
82-
83- extraArgs += $ " -f { defaultTarget } ";
76+ if ( addFrameworkArg )
77+ {
78+ extraArgs += $ " -f { _provider . GetDefaultTargetFramework ( ) } ";
8479 }
8580
8681 using DotNetCommand cmd = new DotNetCommand ( s_buildEnv , _testOutput , useDefaultArgs : false ) ;
@@ -282,7 +277,7 @@ protected void DeleteFile(string pathRelativeToProjectDir)
282277
283278 protected void UpdateBrowserMainJs ( string ? targetFramework = null , string runtimeAssetsRelativePath = DefaultRuntimeAssetsRelativePath )
284279 {
285- targetFramework ??= DefaultTargetFramework ;
280+ targetFramework ??= _provider . GetDefaultTargetFramework ( ) ;
286281 string mainJsPath = Path . Combine ( _projectDir , "wwwroot" , "main.js" ) ;
287282 string mainJsContent = File . ReadAllText ( mainJsPath ) ;
288283 Version targetFrameworkVersion = new Version ( targetFramework . Replace ( "net" , "" ) ) ;
@@ -431,10 +426,10 @@ void OnErrorMessage(string msg)
431426 }
432427
433428 public string GetBinFrameworkDir ( Configuration config , bool forPublish , string ? framework = null , string ? projectDir = null ) =>
434- _provider . GetBinFrameworkDir ( config , forPublish , framework ?? DefaultTargetFramework , projectDir ) ;
429+ _provider . GetBinFrameworkDir ( config , forPublish , framework ?? _provider . GetDefaultTargetFramework ( ) , projectDir ) ;
435430
436431 public string GetObjDir ( Configuration config , string ? framework = null , string ? projectDir = null ) =>
437- _provider . GetObjDir ( config , framework ?? DefaultTargetFramework , projectDir ) ;
432+ _provider . GetObjDir ( config , framework ?? _provider . GetDefaultTargetFramework ( ) , projectDir ) ;
438433
439434 public BuildPaths GetBuildPaths ( Configuration config , bool forPublish ) =>
440435 _provider . GetBuildPaths ( config , forPublish ) ;
0 commit comments