Error "Found invalid data while decoding".

Aberta
#526 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
csharp
Domínio
cli

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
C#
Estrelas
1.7k
Forks
172
Merge médio
1d 19h
PRs com merge (30d)
39

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de dotnet-outdated/dotnet-outdated

Todas as issues de dotnet-outdated/dotnet-outdated

Issues semelhantes

Mais issues de C#

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.