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

Errors running libman CLI commands as a pre-build step in projects building in parallel on an Azure hosted agent

Aperta
#526 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Start by reproducing the two-project parallel build using the libman clean && libman restore pre-build commands and the Azure Pipelines installation steps. Inspect how concurrent CLI invocations access .librarymanager/libman.config.json; done means both projects build successfully without the file-in-use exception.

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

Descrizione

Functional impact

Running into errors building projects in parallel on an Azure Pipelines hosted agent when they both invoke the libman CLI as a pre-build step.

Minimal repro steps
  1. Create a Visual Studio solution with 2 projects that both invoke "libman clean && libman restore" as a pre-build step
  2. Create an Azure Pipeline that
    1. Uses a 'dotnet' task to install the libman CLI to Agent.ToolsDirectory
      dotnet tool install Microsoft.Web.LibraryManager.Cli --tool-path="$(Agent.ToolsDirectory)"
    2. Uses a 'Powershell' task that adds Agent.ToolsDirectory to the environment variables
      Write-Host "##vso[task.setvariable variable=PATH;]${env:PATH};$(Agent.ToolsDirectory)";
    3. Builds the solution in parallel
  3. Run the build on an Azure hosted agent
Expected result

Libman CLI commands run successfully

Actual result

Sometimes I see the following error output for one of the projects which causes the build to fail:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.Web.LibraryManager.Configuration.Settings' threw an exception. ---> System.IO.IOException: The process cannot access the file 'C:\Users\VssAdministrator\.librarymanager\libman.config.json' because it is being used by another process.
Further technical details

I assume the issue is because both commands are running simultaneously and one puts a lock on libman.config.json so the other can't access it. I have run the build on a VM agent and do not see this error, though I installed libman globally on that machine so the 'install Libman CLI' step isn't part of the pipeline that runs on it.

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.