azuredevops上下文中用于dotnet的新版本CycloneDX的问题



随着cyclonedx dotnet工具的新发布,我们的SBOM自动生成不再工作。

对于2.3.0版本,一切都很好。对于版本2.4.1(最新版本(,该工具在扫描dotnet/corefx:时显示警告

正在检索存储库dotnet/corefx和ref master的GitHub许可证GitHub API失败,状态代码为NotFound,消息为Not Found。在GitHub上找不到使用ref master的存储库dotnet/corefx的许可证正在检索存储库dotnet/corefx和ref master的GitHub许可证GitHub API失败,状态代码为NotFound,消息为Not Found。…

之后,它提出了以下异常:

未处理的异常。系统IO.InvalidDataException:中央目录已损坏。--->系统IO.IO异常:试图移动流开始之前的位置。在系统中。IO.MemoryStream.Seek(Int64偏移量,SeekOrigin位置(在系统中。IO.Compression.ZipArchive.ReadEndOfCentralDirectory((---内部异常堆栈跟踪结束---在系统中。IO.Compression.ZipArchive.ReadEndOfCentralDirectory((在系统中。IO.Compression.ZipArchive.ctor(流流,ZipArchiveMode模式,布尔leaveOpen,编码入口名称编码(在CycloneDX。服务。NugetV3Service。/home/runner/work/cyconedx-dotnet/cyconeDX/Services/NugetV3Service.cs:line 315中的GetNuspec(字符串名称、字符串版本、字符串nuspecFilename、FindPackageByIdResource资源(在CycloneDX。服务。NugetV3Service。/home/runner/work/cyconedx-dotnet/cyconeDX/Services/NugetV3Service.cs:line 315中的GetNuspec(字符串名称、字符串版本、字符串nuspecFilename、FindPackageByIdResource资源(在CycloneDX。服务。NugetV3Service。/home/runner/work/cyconedex dotnet/cyconedx/Services/NugetV3Service.cs:line 231中的GetComponentAsync(字符串名称,字符串版本,可为null的`1作用域(在CycloneDX。服务。NugetV3Service。/home/runner/work/cyconedx-dotnet/cyconeDX/Services/NugetV3Service.cs:line 322中的GetComponentAsync(NugetPackage-NugetPackage(在CycloneDX。程序/home/runner/work/cyconedx dotnet/cyconedex dotnet/CyconeDX/Program.cs:line 281中的OnExecuteAsync(CommandLineApplication应用程序(在麦克马斯特。扩展。CommandLineUtils。公约。ExecuteMethodConvention。InvokeAsync(MethodInfo方法、Object实例、Object[]参数(在麦克马斯特。扩展。CommandLineUtils。公约。ExecuteMethodConvention。OnExecute(ConventionContext上下文,CancellationToken取消令牌(在麦克马斯特。扩展。CommandLineUtils。公约。ExecuteMethodConvention<gt;c__DisplayClass0_0。<b_ 0>d.MoveNext((---上一位置的堆栈结束跟踪---在麦克马斯特。扩展。CommandLineUtils。命令行应用程序。ExecuteAsync(String[]参数,CancellationToken取消令牌(在麦克马斯特。扩展。CommandLineUtils。命令行应用程序。ExecuteAsync[TApp](CommandLineContext上下文,CancellationToken取消令牌(在CycloneDX。程序/home/runner/work/cyconedx dotnet/cyconedex dotnet/CyconeDX/Program.cs:line 130中的Main(String[]args(在CycloneDX。程序(String[]args(

有人在azure devops或其他工具中遇到过这个问题吗?

通过docker和2.7.0版运行时,我也出现了同样的错误

解决方案是允许包恢复(不要--disable-package-restore(,并给出--url参数,指向我们的内部nuget存储库。

我的电话现在看起来像

docker run --rm -v "$PWD:/app" -w /app 
cyclonedx/cyclonedx-dotnet 
--json -f /app/service.bom.json -o /app 
--exclude-test-projects 
--exclude-dev 
-gt token -gu user  
--url https://nuget-repo-url/index.json
./service.sln

最新更新