Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

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

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/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
build-system, cli

Hướng nghiên cứu

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.

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

Mô tả

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.

Ngôn ngữ chính
C#
Star
486
Fork
91
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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

Tất cả issue của aspnet/LibraryManager

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.