Skip to content

NuGet.Build.Tasks.Pack.targets file lock prevents .nupkg access during dotnet publish #14689

@Varorbc

Description

@Varorbc

NuGet Product Used

dotnet.exe

Product Version

10.0.100

Worked before?

No response

Impact

It bothers me. A fix would be nice

Repro Steps & Context

Describe the bug

When running the following command in an Azure DevOps pipeline, we occasionally hit a file lock error.This issue is intermittent — it does not reproduce every run.

To Reproduce

dotnet publish /azp/_work/5/s/src/Test/Test.csproj -c Release -t:PublishContainer -p RuntimeIdentifiers="linux-x64;linux-arm64"

Exceptions (if any)

/azp/_work/_tool/dotnet/sdk/10.0.100/NuGet.Build.Tasks.Pack.targets(222,5): error : The process cannot access the file '/azp/_work/5/s/nugets/A.nupkg' because it is being used by another process. [/azp/_work/5/s/src/A/A.csproj]

Verbose Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions