Se comparte la infracción IOException al leer y escribir en el archivo C #

Aquí está mi código:

public static TextWriter twLog = null;
private int fileNo = 1;
private string line = null;

TextReader tr = new StreamReader("file_no.txt");
TextWriter tw = new StreamWriter("file_no.txt");
line = tr.ReadLine();
if(line != null){
    fileNo = int.Parse(line);
    twLog = new StreamWriter("log_" + line + ".txt");
}else{
    twLog = new StreamWriter("log_" + fileNo.toString() + ".txt");  
}
System.IO.File.WriteAllText("file_no.txt",string.Empty);
tw.WriteLine((fileNo++).ToString());
tr.Close();
tw.Close();
twLog.Close();

Lanza este error:

IOException: infracción de uso compartido en la ruta C: \ Users \ Water Simulation \ file_no.txt

Lo que estoy tratando de hacer es simplemente abrir un archivo con el nombre log_x.txt y tomar la "x" del archivo file_no.txt. to file_no.txt.Después de que un nuevo programa inicie, el nuevo nombre del archivo de registro debe ser log_2.txt.Pero estoy recibiendo este error y no pude entender qué estoy haciendo mal.

Respuestas a la pregunta(3)

Su respuesta a la pregunta