Environment:
- Version: 5.6.6
- Branch:
- Installation/Running method:
- Operating System:
Describe the bug
DotNet Core Tool, with .sln file input build, elaborate but don't analyze projects.
In this point of Program.cs, in foreach body the add in the list of valid projects has been omitted:
|
List<Project> projects; |
|
if (parsedOptions.solutionPath.EndsWith(".sln")) |
|
{ |
|
Console.WriteLine($"Loading solution '{parsedOptions.solutionPath}'"); |
|
// Attach progress reporter so we print projects as they are loaded. |
|
var solution = await workspace.OpenSolutionAsync(parsedOptions.solutionPath, new ConsoleProgressReporter(parsedOptions.verbose)).ConfigureAwait(false); |
|
projects = new List<Project>(solution.Projects.Count()); |
|
|
|
foreach (var project in solution.Projects) |
|
{ |
|
if (project.FilePath.EndsWith(".shproj") || project.FilePath.EndsWith(".sqlproj") || project.FilePath.EndsWith(".fsproj")) |
|
{ |
|
Console.WriteLine($"Skipped: {project.FilePath} excluded from analysis"); |
|
continue; |
|
} |
|
|
|
var path = project.FilePath; |
|
if (path.StartsWith(solutionDirectory)) |
|
path = path.Remove(0, solutionDirectory.Length); |
|
|
|
if ((parsedOptions.includeProjects.Any() && !parsedOptions.includeProjects.Any(x => x.IsMatch(path))) || |
|
parsedOptions.excludeProjects.Any(x => x.IsMatch(path))) |
|
{ |
|
Console.WriteLine($"Skipped: {project.FilePath} excluded from analysis"); |
|
continue; |
|
} |
|
} |
|
} |
Repro
Run tool with always .sln project.
Environment:
Describe the bug
DotNet Core Tool, with
.slnfile input build, elaborate but don't analyze projects.In this point of
Program.cs, inforeachbody the add in the list of valid projects has been omitted:security-code-scan/SecurityCodeScan.Tool/Program.cs
Lines 317 to 344 in 21d1d5c
Repro
Run tool with always .sln project.