Standalone scanner throws exception: 'ProjectName' is already part of the workspace

Environment:

  • Version: 5.6.5
  • 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
Standalone scanner throws exception with newest version v5.6.5. Everything works fine with v5.6.3.

dotnet tool install --global security-scan
security-scan $(solution)

Output:

❯ security-scan payment.sln

╔═╗┌─┐┌─┐┬ ┬┬─┐┬┌┬┐┬ ┬  ╔═╗┌─┐┌┬┐┌─┐  ╔═╗┌─┐┌─┐┌┐┌
╚═╗├┤ │  │ │├┬┘│ │ └┬┘  ║  │ │ ││├┤   ╚═╗│  ├─┤│││
╚═╝└─┘└─┘└─┘┴└─┴ ┴  ┴   ╚═╝└─┘─┴┘└─┘  ╚═╝└─┘┴ ┴┘└┘

.NET tool by Jaroslav Lobačevski v5.6.5


Loading solution '[removed].sln'
Resolve         0:00.0171850    Application.csproj (net6.0)
Resolve         0:00.0120746    Infrastructure.csproj (net6.0)
Resolve         0:00.5166888    WebApi.csproj (net6.0)
Unhandled exception. System.ArgumentException: 'Application' is already part of the workspace.
   at Microsoft.CodeAnalysis.Workspace.CheckProjectIsNotInCurrentSolution(ProjectId projectId)
   at Microsoft.CodeAnalysis.Workspace.OnProjectAdded_NoLock(ProjectInfo projectInfo, Boolean silent)
   at Microsoft.CodeAnalysis.Workspace.OnProjectAdded(ProjectInfo projectInfo, Boolean silent)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.OpenProjectAsync(String projectFilePath, ILogger msbuildLogger, IProgress`1 progress, CancellationToken cancellationToken)
   at SecurityCodeScan.Tool.Program.Main(String[] args) in D:\a\security-code-scan\security-code-scan\SecurityCodeScan.Tool\Program.cs:line 378
   at SecurityCodeScan.Tool.Program.<Main>(String[] args)