-
-
Notifications
You must be signed in to change notification settings - Fork 161
Closed
Description
Environment:
- Version: 5.6.6
- Branch:
- vs2019
- vs2017
- vs2015
- Installation/Running method:
- Visual Studio Extension
- NuGet package
- Standalone tool
- DotNet Core Tool from NuGet
- security-scan4x.zip from GitHub Release section
- Operating System:
- Windows
- Linux
- Mac
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:
security-code-scan/SecurityCodeScan.Tool/Program.cs
Lines 317 to 344 in 21d1d5c
| 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.
Metadata
Metadata
Assignees
Labels
No labels