.Net Core文件多线程读取报错

错误:System.IO.IOException:“The process cannot access the file 'xxx1.txt' because it is being used by another process.”

解决:

FileStream fileStream = new FileStream(fileName, FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
FileShare.ReadWrite需要加上共享去读写的权限
原文地址:https://www.cnblogs.com/deehuang/p/13928593.html