[11.0-preview.5] Unable to build solution on Windows in CI due to MSB4181 errors
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Describe the bug
Trying to update Swashbuckle.AspNetCore from 11.0 preview.4 to preview.5 (https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/3988), I'm consistently getting MSB4181 errors on Windows in CI ([12 failed attempts in a row](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/actions/runs/27221857459)).
We already [don't build in parallel](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/677cc9ae630b2285e343c30a7b684d8d6eadf202/Directory.Build.props#L5-L6), so that's not a simple one-line fix/workaround either.
I don't get this problem locally on Windows 11, which also doesn't help 😅
The problem also doesn't present with 10.0.301.
### Steps to reproduce
Attempt to build https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/3988/commits/d762b65742524d3c1c65a0465607b105de3b337d on Windows.
### Expected behavior
The solution builds.
### Actual behavior
The solution fails to build. [For example](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/actions/runs/27263330836/job/80514201497?pr=3988#step:8:156):
```text
D:\tools\dotnet\sdk\11.0.100-preview.5.26302.115\Microsoft.Common.CurrentVersion.targets(4919,5): warning MSB3026: Could not copy "D:\a\Swashbuckle.AspNetCore\Swashbuckle.AspNetCore\artifacts\obj\Swashbuckle.AspNetCore.ReDoc\release_net11.0\Swashbuckle.AspNetCore.ReDoc.dll" to "D:\a\Swashbuckle.AspNetCore\Swashbuckle.AspNetCore\artifacts\bin\Swashbuckle.AspNetCore.ReDoc\release_net11.0\Swashbuckle.AspNetCore.ReDoc.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a\Swashbuckle.AspNetCore\Swashbuckle.AspNetCore\artifacts\bin\Swashbuckle.AspNetCore.ReDoc\release_net11.0\Swashbuckle.AspNetCore.ReDoc.dll' because it is being used by another process. The file is locked by: ".NET Host (3016)" [D:\a\Swashbuckle.AspNetCore\Swashbuckle.AspNetCore\src\Swashbuckle.AspNetCore.ReDoc\Swashbuckle.AspNetCore.ReDoc.csproj::TargetFramework=net11.0]
```
### Is this a regression?
Yes.
### Are there any workarounds?
_No response_
### dotnet --info output
```console
```
### IDE version
_No response_
### Other details
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.