Error "Found invalid data while decoding".

Đang mở
#526 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
cli

Hướng nghiên cứu

The crash starts in DependencyGraphService.GenerateDependencyGraph (src/DotNetOutdated.Core/Services/DependencyGraphService.cs), called from ProjectAnalysisService.AnalyzeProject and Program.OnExecute. Reproduce with the solution from the issue, which lists a .phpproj that may not exist, and check where project entries are enumerated before the graph is loaded. Done when unsupported project types are skipped with a message and the run completes. The stack trace line numbers are from 2022 and may have shifted.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Running this command line:

dotnet-outdated "c:\myfolder\mysln.sln" -u

On that SLN:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31815.197
MinimumVisualStudioVersion = 10.0.40219.1
Project("{A0786B88-2ADB-4C21-ABE8-AA2D79766269}") = "PhpServerComponent", "PhpServerComponent\PhpServerComponent.phpproj", "{2A8E39B9-5D74-4AD5-9021-09B376068984}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{2A8E39B9-5D74-4AD5-9021-09B376068984}.Release|Any CPU.ActiveCfg = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {3CD6D34D-D6F0-424C-9A20-A300D6018781}
	EndGlobalSection
EndGlobal

Results on dotnet-outdated being crashing with:

Unhandled exception. System.IO.InvalidDataException: Found invalid data while decoding.
   at NuGet.ProjectModel.DependencyGraphSpec.Load(String path)
   at DotNetOutdated.Core.Services.DependencyGraphService.GenerateDependencyGraph(String projectPath) in /home/runner/work/dotnet-outdated/dotnet-outdated/src/DotNetOutdated.Core/Services/DependencyGraphService.cs:line 46
   at DotNetOutdated.Core.Services.ProjectAnalysisService.AnalyzeProject(String projectPath, Boolean runRestore, Boolean includeTransitiveDependencies, Int32 transitiveDepth) in /home/runner/work/dotnet-outdated/dotnet-outdated/src/DotNetOutdated.Core/Services/ProjectAnalysisService.cs:line 28
   at DotNetOutdated.Program.<OnExecute>b__78_0(String path) in /home/runner/work/dotnet-outdated/dotnet-outdated/src/DotNetOutdated/Program.cs:line 185
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.ToList()
   at DotNetOutdated.Program.OnExecute(CommandLineApplication app, IConsole console) in /home/runner/work/dotnet-outdated/dotnet-outdated/src/DotNetOutdated/Program.cs:line 185
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at DotNetOutdated.Program.Main(String[] args) in /home/runner/work/dotnet-outdated/dotnet-outdated/src/DotNetOutdated/Program.cs:line 137

Please note that the solution only contains a .phpproj project reference created with DevSense.

It seems to make no difference whether the refered .phpproj file actually exists or not.

My question

Could you please make dotnet-outdated not creash in such a scenario?

I'm running dotnet-outdated from within a script that walks all SLN files in a certain folder tree and it would help me if dotnet-outdated simply ignores unexpected project types (instead of crashing).

Otherwise I probably would have to manually parse the SLN for .csproj files.

Ngôn ngữ chính
C#
Star
1.7k
Fork
172
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
39

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet-outdated/dotnet-outdated

Tất cả issue của dotnet-outdated/dotnet-outdated

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.