Errors thrown for some packages when updating, but still successfully update. Some packages fail to update.

Aperta
#580 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
build-system, cli

Direzione di ricerca

The payload names the log lines 'An error occurred while upgrading' and 'Failed to restore project after upgrading!', plus a Directory.Packages.Props file, but no source files. Start by reproducing with a multi-project solution that uses central package management, then find where the upgrade success message is printed relative to the restore step. Done means a failed restore is reported as a failure, the reason is logged, and the packages in the file match what the log claims.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Running the version 4.6.4 of dotnet-outdated on .Net 8 projects, some packages throws errors in the log when the tool tries to update them. Some packages fail to update at all.

This is the current list packages that I'm trying to update as an example:

» Project 1
  [net8.0]
  Azure.Storage.Blobs                                    12.21.1 -> 12.21.2
  Microsoft.AspNetCore.Authentication.JwtBearer          8.0.7   -> 8.0.8  
  Microsoft.AspNetCore.Authentication.OpenIdConnect      8.0.7   -> 8.0.8
  Microsoft.AspNetCore.Mvc.NewtonsoftJson                8.0.7   -> 8.0.8
  Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson  8.0.7   -> 8.0.8
  Microsoft.AspNetCore.SpaServices.Extensions            8.0.7   -> 8.0.8
  Microsoft.EntityFrameworkCore.Design                   8.0.7   -> 8.0.8
  Microsoft.EntityFrameworkCore.SqlServer                8.0.7   -> 8.0.8
  Microsoft.Extensions.Http.Polly                        8.0.7   -> 8.0.8
  Microsoft.Extensions.Logging.AzureAppServices          8.0.7   -> 8.0.8
  StrawberryShake.Server                                 13.9.9  -> 13.9.11

» Project 2
  [net8.0]
  Microsoft.EntityFrameworkCore.InMemory  8.0.7 -> 8.0.8

» Project 3
  [net8.0]
  FSharp.Core  8.0.301 -> 8.0.400

» Project 4
  [net8.0]
  FSharp.Core  8.0.301 -> 8.0.400

» Project 5
  [net8.0]
  Microsoft.EntityFrameworkCore            8.0.7 -> 8.0.8
  Microsoft.EntityFrameworkCore.Proxies    8.0.7 -> 8.0.8
  Microsoft.EntityFrameworkCore.SqlServer  8.0.7 -> 8.0.8
  Microsoft.EntityFrameworkCore.Tools      8.0.7 -> 8.0.8

» Project 6
  [net8.0]
  FSharp.Core  8.0.301 -> 8.0.400

Updating with the tool produces the following logs:

Upgrading package Azure.Storage.Blobs...
Project 1 [net8.0] upgraded successfully
Upgrading package Microsoft.AspNetCore.Authentication.JwtBearer...
Project 1 [net8.0] upgraded successfully
Upgrading package Microsoft.AspNetCore.Authentication.OpenIdConnect...
Project 1 [net8.0] upgraded successfully
Upgrading package Microsoft.AspNetCore.Mvc.NewtonsoftJson...
Project 1 [net8.0] upgraded successfully
Upgrading package Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson...
Project 1 [net8.0] upgraded successfully
Upgrading package Microsoft.AspNetCore.SpaServices.Extensions...
Project 1 [net8.0] upgraded successfully

Upgrading package Microsoft.EntityFrameworkCore.Design...
Project 1 [net8.0] upgraded successfully

Upgrading package Microsoft.EntityFrameworkCore.SqlServer...
An error occurred while upgrading 1
Failed to restore project after upgrading!
An error occurred while upgrading 5
Failed to restore project after upgrading!

Upgrading package Microsoft.Extensions.Http.Polly...
An error occurred while upgrading 1
Failed to restore project after upgrading!

Upgrading package Microsoft.Extensions.Logging.AzureAppServices...
An error occurred while upgrading 1
Failed to restore project after upgrading!

Upgrading package StrawberryShake.Server...
An error occurred while upgrading 1
Failed to restore project after upgrading!

Upgrading package Microsoft.EntityFrameworkCore.InMemory...
An error occurred while upgrading 2
Failed to restore project after upgrading!

Upgrading package FSharp.Core...
Project 3 [net8.0] upgraded successfully
Project 4 [net8.0] upgraded successfully
Project 6 [net8.0] upgraded successfully

Upgrading package Microsoft.EntityFrameworkCore...
Project 5 [net8.0] upgraded successfully

Upgrading package Microsoft.EntityFrameworkCore.Proxies...
Project 5 [net8.0] upgraded successfully

Upgrading package Microsoft.EntityFrameworkCore.Tools...
Project 5 [net8.0] upgraded successfully

Running the tool again afterwards to check the packages:

» Project 1
  [net8.0]
  Microsoft.EntityFrameworkCore.Design  8.0.7 -> 8.0.8

» Project 5
  [net8.0]
  Microsoft.EntityFrameworkCore.Tools  8.0.7 -> 8.0.8

Screenshot of the resulting Directory.Packages.Props file
We can see that Microsoft.EntityFrameworkCore.Design and Microsoft.EntityFrameworkCore.Tools weren't updated.
Screenshot 2024-08-14 135233

For some reason, even though the logs state that these packages were upgraded successfully, they weren't actually upgraded.
And multiple packages that the logs state caused errors, were upgraded successfully.

It would be helpful if the logs were more informative as to why the tool failed to restore the project.

Lingua principale
C#
Stelle
1.7k
Fork
172
Merge medio
1g 19h
PR unite (30g)
39

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet-outdated/dotnet-outdated

Tutte le issue di dotnet-outdated/dotnet-outdated

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.