File tree Expand file tree Collapse file tree
src/JD.Efcpt.Build.Tasks/Utilities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,8 +102,31 @@ public static bool IsDnxAvailable(string dotnetExe)
102102 return false ;
103103 }
104104
105- // If we can list runtimes and .NET 10 SDK is installed, dnx is available
106- return process . ExitCode == 0 && IsDotNet10SdkInstalled ( dotnetExe ) ;
105+ if ( process . ExitCode != 0 )
106+ {
107+ return false ;
108+ }
109+
110+ // If we can list runtimes and at least one .NET 10 runtime is present, dnx is available
111+ foreach ( var line in output . Split ( new [ ] { '\n ' } , StringSplitOptions . RemoveEmptyEntries ) )
112+ {
113+ var trimmed = line . Trim ( ) ;
114+ if ( string . IsNullOrEmpty ( trimmed ) )
115+ continue ;
116+
117+ // Expected format: "<runtimeName> <version> [path]"
118+ var parts = trimmed . Split ( new [ ] { ' ' } , StringSplitOptions . RemoveEmptyEntries ) ;
119+ if ( parts . Length < 2 )
120+ continue ;
121+
122+ var versionStr = parts [ 1 ] ;
123+ if ( Version . TryParse ( versionStr , out var version ) && version . Major >= 10 )
124+ {
125+ return true ;
126+ }
127+ }
128+
129+ return false ;
107130 }
108131 catch
109132 {
You can’t perform that action at this time.
0 commit comments