Skip to content

C#MS Release build fails with file lock error (workaround: retry) #4563

Description

@allister-beamable

Description

When triggering a Release (publish) build with 2 or more C# microservices, the build process launches them in parallel. Both services attempt to write the shared Unity.Beamable.Customer.Common output at the same time, causing a file lock conflict and failing both builds.

Workaround: Trigger the Release process a second time — by then the common assembly is already present and the conflict does not recur.

Environment

  • Beamable Unity SDK: 5.0.1
  • Unity Editor: 6000.3.12f1
  • macOS: Tahoe 26.3.1 (a)
  • Hardware: MacBook Pro 16-inch Nov 2024, Apple M4 Max, 64 GB RAM
  • dotnet SDK: 8.0.302

Steps to Reproduce

  1. Create a Unity project with 2+ C# microservices (e.g. AllisterLatestMicroservice, SecondaryService) — reported by Allister MacLeod
  2. Open the Beamable publish/release window and trigger a Release build
  3. Both services build in parallel

Expected Result

Both services build successfully.

Actual Result

Both services fail. The first service to win the race locks Unity.Beamable.Customer.Common.dll and .deps.json; the second service cannot write them.

Errors

error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
System.IO.IOException: The process cannot access the file
  '.../Unity.Beamable.Customer.Common/bin/Release/net8.0/Unity.Beamable.Customer.Common.deps.json'
  because it is being used by another process.

error CS2012: Cannot open
  '.../Unity.Beamable.Customer.Common/obj/Release/net8.0/Unity.Beamable.Customer.Common.dll'
  for writing -- 'The process cannot access the file ... because it is being used by another process.'

Root Cause (suspected)

The parallel build processes each independently try to build Unity.Beamable.Customer.Common.csproj. The shared output should either be built once before the service builds begin, or service builds should be serialized.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions