You need to specify FileShare.Read :
using (Stream stream = File.Open(path2, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read)) using (TextWriter writer = new StreamWriter(stream)) { writer.Write(SomeText); }
This will allow other processes to open the file for reading rather than writing.
Thomas levesque
source share