Race condition on text resources processed in multiple project instances #7229
Labels
bug
Task: GenerateResource
Problems with the task itself, resgen.exe, and resx resources in general.
triaged
Milestone
We have periodically seen this failure in our own build:
Today I looked into it. I suspect this flow of things:
msbuild/src/Tasks/GenerateResource.cs
Lines 3561 to 3565 in 797fd82
msbuild/src/Tasks/GenerateResource.cs
Lines 3876 to 3877 in 797fd82
File.Open
does not specifyFileShare.Read
, which defaults to "no sharing". So if this is run on the same file in parallel (for instance, in our Tasks project which is multitargeted), there's a possibility that the second attempt to read the file fails because the first one is still holding a lock.The text was updated successfully, but these errors were encountered: