@@ -131,7 +131,7 @@ private async IAsyncEnumerable<DiscoveryResult> FindAllSolutionsAndProjects(stri
131
131
/* SLN found no projs */ ( not null , 1 , 0 , _, _, false , _, _) => new DiscoveryResult ( DiscoveryResult . RETURN_SLN_NOPROJ , item , project ) ,
132
132
/* SLN found no projs, del */ ( not null , 1 , 0 , _, _, true , _, _) => new DiscoveryResult ( DiscoveryResult . RETURN_GOOD , item , project ) ,
133
133
/* Project found */ ( not null , 0 , 1 , _, _, _, _, _) => new DiscoveryResult ( DiscoveryResult . RETURN_GOOD , item , project ) ,
134
- /* Single .cs file compile */ ( null , 0 , 0 , 1 , _ , _ , _ , true ) => new DiscoveryResult ( DiscoveryResult . RETURN_GOOD , item , item ) ,
134
+ /* Single .cs file compile */ ( not null , 0 , 0 , 1 , _, _, _, true ) => new DiscoveryResult ( DiscoveryResult . RETURN_GOOD , item , project ) ,
135
135
/* Code no proj */ ( null , 0 , 0 , > 0 , _, _, _, _) => new DiscoveryResult ( DiscoveryResult . RETURN_NOPROJ , item , "" ) ,
136
136
/* Code no proj */ ( null , 0 , 0 , _, > 0 , _, _, _) => new DiscoveryResult ( DiscoveryResult . RETURN_NOPROJ , item , "" ) ,
137
137
/* catch all */ _ => new DiscoveryResult ( DiscoveryResult . RETURN_NOPROJ , item , "CONDITION NOT FOUND" ) ,
@@ -231,8 +231,18 @@ static void ScanFile(string file, ref string? project, ref int countOfSln, ref i
231
231
232
232
// If a code file
233
233
else if ( EnvExtensionsCodeTriggers . Contains ( ext , StringComparer . OrdinalIgnoreCase ) )
234
+ {
234
235
countOfCode ++ ;
235
236
237
+ // Case for .NET 10 single file app
238
+ // No solution or projects found, process a C# file
239
+ if ( countOfSln == 0 && countOfProjs == 0 && ext . Equals ( ".cs" , StringComparison . OrdinalIgnoreCase ) )
240
+ {
241
+ // First code file can be a project, anything else is invalid
242
+ project = countOfCode == 1 ? file : null ;
243
+ }
244
+ }
245
+
236
246
// If a special trigger file
237
247
else if ( EnvFileTriggers . Contains ( Path . GetFileName ( file ) , StringComparer . OrdinalIgnoreCase ) )
238
248
countOfSpecial ++ ;
0 commit comments