黑鸭扫描未能检测到 .Net 6 项目并在 Github Workflow 中检测到版本 7

4

我正在尝试将黑鸭扫描作为 Github 工作流程的一部分运行,在该工作流程中,我的项目是使用 .Net 版本 6.0.2 构建的。

我的黑鸭扫描步骤如下:

- name: Perform Blackduck Analysis
        uses: blackducksoftware/github-action@v2.2
        with:
          version: 7
          blackduck.url: ${{ secrets.BLACKDUCK_URL }}
          blackduck.api.token: ${{ secrets.BLACKDUCK_TOKEN }}
          args: --detect.project.name="${{ env.BLACKDUCK_PROJECT_NAME }}"
            --detect.blackduck.signature.scanner.upload.source.mode=false
            --detect.project.version.name="${{ env.BLACKDUCK_PROJ_VERSION }}"
            --detect.wait.for.results=false
            --logging.level.com.synopsys.integration=DEBUG
            --detect.risk.report.pdf=false
            --detect.timeout=3600
            --detect.detector.search.depth=9
            --detect.project.codelocation.unmap=true

我遇到了一个问题,在扫描过程中出现了错误。

2022-02-26 16:56:53 UTC DEBUG [main-Executable_Stream_Thread] --- It was not possible to find any compatible framework version
2022-02-26 16:56:53 UTC DEBUG [main-Executable_Stream_Thread] --- The framework 'Microsoft.NETCore.App', version '2.0.0' (x64) was not found.
2022-02-26 16:56:53 UTC DEBUG [main-Executable_Stream_Thread] ---   - The following frameworks were found:
2022-02-26 16:56:53 UTC DEBUG [main-Executable_Stream_Thread] ---       6.0.2 at [/home/runner/.dotnet/shared/Microsoft.NETCore.App]
2022-02-26 16:56:53 UTC DEBUG [main-Executable_Stream_Thread] --- 
2022-02-26 16:56:53 UTC DEBUG [main-Executable_Stream_Thread] --- You can resolve the problem by installing the specified framework and/or SDK.
2022-02-26 16:56:53 UTC DEBUG [main-Executable_Stream_Thread] --- 
2022-02-26 16:56:53 UTC DEBUG [main-Executable_Stream_Thread] --- The specified framework can be found at:
2022-02-26 16:56:53 UTC DEBUG [main-Executable_Stream_Thread] ---   - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=ubuntu.20.04-x64
2022-02-26 16:56:53 UTC INFO  [main] --- Process return code: 150
2022-02-26 16:56:53 UTC DEBUG [main] --- ------------------------------------------------------------------------------------------------------
2022-02-26 16:56:53 UTC DEBUG [main] --- Finished extraction: EXCEPTION

我尝试安装 .Net Core v2.0.0 和 v6.0.2(使用v6构建项目),但出现不同的错误。

2022-02-26 17:11:36 UTC DEBUG [main-Executable_Stream_Thread] --- Registering MSBuild defaults.
2022-02-26 17:11:36 UTC DEBUG [main-Executable_Stream_Thread] --- No usable version of the libssl was found
2022-02-26 17:11:36 UTC INFO  [main] --- Process return code: 134
2022-02-26 17:11:36 UTC DEBUG [main] --- ------------------------------------------------------------------------------------------------------
2022-02-26 17:11:36 UTC DEBUG [main] --- Finished extraction: EXCEPTION
2022-02-26 17:11:36 UTC DEBUG [main] --- Code locations found: 0
2022-02-26 17:11:36 UTC DEBUG [main] --- Exception: DetectableException: Executing the nuget inspector failed: 134
2022-02-26 17:11:36 UTC DEBUG [main] --- Details: 

com.synopsys.integration.detectable.detectable.exception.DetectableException: Executing the nuget inspector failed: 134
    at com.synopsys.integration.detectable.detectables.nuget.NugetInspectorExtractor.executeTarget(NugetInspectorExtractor.java:93) ~[detectable-7.11.1.jar!/:na]

请问我错过了什么,或者应该如何解决这个问题?

附言:我的项目不能使用 .Net 2.x 构建,它的结构看起来像这样:

.
├── XYZ
│   ├── XYZ.csproj
│   ├── ABC.cs
│   ├── DEF.cs
│   ├── bin
│   │   └── Debug
│   │       └── net6.0
│   │           ├── XYZ.deps.json
│   │           ├── XYZ.dll
│   │           └── XYZ.pdb
│   └── obj
│       ├── XYZ.csproj.nuget.dgspec.json
│       ├── XYZ.csproj.nuget.g.props
│       ├── XYZ.csproj.nuget.g.targets
│       ├── Debug
│       │   └── net6.0
│       │       ├── XYZ.AssemblyInfo.cs
│       │       ├── XYZ.AssemblyInfoInputs.cache
│       │       ├── XYZ.GeneratedMSBuildEditorConfig.editorconfig
│       │       ├── XYZ.GlobalUsings.g.cs
│       │       ├── XYZ.assets.cache
│       │       ├── XYZ.csproj.AssemblyReference.cache
│       │       ├── XYZ.csproj.CoreCompileInputs.cache
│       │       ├── XYZ.csproj.FileListAbsolute.txt
│       │       ├── XYZ.dll
│       │       ├── XYZ.pdb
│       │       ├── ref
│       │       │   └── XYZ.dll
│       │       └── refint
│       │           └── XYZ.dll
│       ├── project.assets.json
│       └── project.nuget.cache
├── MyProject.sln
├── README.md

我经历了完全相同的过程,并在Azure管道中遇到了相同的错误。正在添加赏金。 - N-ate
你尝试过修复“找不到可用版本的libssl”吗?https://dev.to/n3wt0n/no-usable-version-of-the-libssl-was-found-solved-2ffa - jasie
你尝试过追踪代码134吗?https://github.com/blackducksoftware/synopsys-detect/blob/7.11.1/detectable/src/main/java/com/synopsys/integration/detectable/detectables/nuget/NugetInspectorExtractor.java -> 从第93行开始。 - jasie
1个回答

1

Synopsys检测目前不支持 .Net 6 项目。它目前仅支持 .Net 5 和正在开发中的 .Net 6。


2
你的回答可以通过提供额外的支持信息来改进。请[编辑]以添加进一步的细节,例如引用或文档,以便他人可以确认你的答案正确。你可以在帮助中心找到有关如何编写好答案的更多信息。 - Community

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接