Skip to content

VMR locks files during publishing in a re-build with existing artifacts #4880

@ViktorHofer

Description

@ViktorHofer

I noticed these failures appear when building a repository inside the VMR again (by deleting the artifacts\obj<repo-name>` folder and then invoking build.cmd). I think this started when I switched Publish.proj to use hardlinks when copying files for the VMR. I thought that this got fixed with dotnet/arcade@79e2c58 but I still see the issues with latest main.

   C:\git\dotnet\artifacts\source-built-sdks\Microsoft.DotNet.Arcade.Sdk\tools\Publish.proj(270,5): error : The proces
  s cannot access the file 'C:\git\dotnet\artifacts\packages\Release\Shipping\deployment-tools\Microsoft.Deployment.Dot
  Net.Releases.2.0.0-dev.nupkg' because it is being used by another process.

I couldn't find what's actually locking the file with handle.exe so I assume it must be directly in the Copy operation. This only happens when the file is already there (an incremental build / rebuild). So the first build must not use --clean-while-building to repro this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions