Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Editor exception thrown from filesystem provider if source file doesn't exist

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
devtools

Direzione di ricerca

Start with FilesCompletionProvider.GetEntries in the VSIX stack trace, then inspect FileSystemCatalog.GetLibraryAsync for the missing-source case. Reproduce with the provided libman.json and edit in Visual Studio. Done means editing no longer throws an editor exception, while restore still reports an appropriate error.

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

Descrizione

bug P2
Functional impact

When editing libman.json in Visual Studio, if there is a library entry using the filesystem provider, and the file doesn't exist, it will throw an exception in the editor.

Minimal repro steps
  1. Have a project with the following libman.json:
{
  "version": "1.0",
  "defaultProvider": "filesystem",
  "libraries": [
    {
      "provider": "filesystem",
      "library": "node_modules/jquery/dist/",
      "destination": "wwwroot/lib/",
      "files": [ 
        "jquery.min.js" 
      ]
    }
  ]
}
  1. Make sure the source files (in the node_modules folder) do not exist
  2. Make an edit in the editor
Expected result

Edits can happen fine, a restore will fail with an appropriate error

Actual result

As soon as I make an edit (e.g. type any character), I get an error from VS and an entry in the ActivityLog:

System.AggregateException: One or more errors occurred. ---> Microsoft.Web.LibraryManager.Contracts.InvalidLibraryException: The "node_modules/jquery/dist/" library could not be resolved by the "filesystem" provider at Microsoft.Web.LibraryManager.Providers.FileSystem.FileSystemCatalog.d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result() at Microsoft.Web.LibraryManager.Vsix.FilesCompletionProvider.d__2.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at Microsoft.JSON.Editor.Completion.JSONCompletionSource.<>c__DisplayClass3_2.b__0() at Microsoft.Web.Editor.Utility.GuardedOperations.InvokeExtensionPoint(Object errorSource, Action action) ---> (Inner Exception #0) Microsoft.Web.LibraryManager.Contracts.InvalidLibraryException: The "node_modules/jquery/dist/" library could not be resolved by the "filesystem" provider at Microsoft.Web.LibraryManager.Providers.FileSystem.FileSystemCatalog.d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)<---
--

Lingua principale
C#
Stelle
486
Fork
91
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

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 aspnet/LibraryManager

Tutte le issue di aspnet/LibraryManager

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.