-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Expected Behaviour
Building a large solution (80+ projects) with AWS.Lambda.Powertools.Logging 3.0.0 should complete successfully with parallel builds enabled.
Current Behaviour
MSBuild fails with file locking errors when multiple projects reference a common assembly that depends on Powertools 3.0.0:
warning MSB3061: Unable to delete file "...<project>\bin\Debug\net8.0<project>.dll". The process cannot access the file because it is being used by another process. The file is locked by: "MSBuild.exe (21664), MSBuild.exe (17708), MSBuild.exe (11540)..."
The issue occurs with both Visual Studio and CLI builds (dotnet build
).
Root Cause
Powertools 3.0.0 upgraded AspectInjector from 2.8.1 to 2.9.0. AspectInjector 2.9.0 https://github.com/pamidur/aspect-injector/releases/tag/2.9.0, which appears to cause file locking issues when processing assemblies in parallel build scenarios.
Code snippet
**<project>.csproj** (shared assembly referenced by 70+ projects):
<ItemGroup>
<PackageReference Include="AWS.Lambda.Powertools.Logging" Version="3.0.0" />
<!-- other dependencies -->
</ItemGroup>
Possible Solution
No response
Steps to Reproduce
- Create a large solution with a common shared library referenced by many projects
- Add AWS.Lambda.Powertools.Logging version 3.0.0 to the shared library
- Build the solution with parallel builds enabled (default)
- Observe MSBuild file locking errors on the shared library assembly
Note: The issue does NOT occur with Powertools 2.0.2 (AspectInjector 2.8.1) in the same solution.
Powertools for AWS Lambda (.NET) version
3.0.0
AWS Lambda function runtime
dotnet8
Debugging logs
Metadata
Metadata
Assignees
Labels
Type
Projects
Status