Skip to content

Commit

Permalink
Share read for text resource files (#7230)
Browse files Browse the repository at this point in the history
Fixes #7229 by ensuring that MSBuild's processing of a `.txt` resource holds only the minimal lock: open for read and allowing other processes to read while it's open.
  • Loading branch information
rainersigwald authored Jan 7, 2022
1 parent 0006147 commit 64edb33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tasks/GenerateResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3876,7 +3876,7 @@ internal sealed class LineNumberStreamReader : StreamReader
private int _col;

internal LineNumberStreamReader(String fileName, Encoding encoding, bool detectEncoding)
: base(File.Open(fileName, FileMode.Open, FileAccess.Read), encoding, detectEncoding)
: base(File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read), encoding, detectEncoding)
{
_lineNumber = 1;
_col = 0;
Expand Down

0 comments on commit 64edb33

Please sign in to comment.