❔ StreamReader and File.WriteAllText are stepping on each others toes.
I'm currently writing what I thought was a pretty straightforward piece of code. First I read a bunch of data from a file into a list using StreamReader and when I've done all my edits, I overwrite the contents of the file using File.WriteAllText. See appended images.
However, I'm currently getting an exception when the code hits the File.WriteAllText line telling me that it can't access the file, because it is already in use by another process. What am I not seeing here? Would really appreciate the help!
However, I'm currently getting an exception when the code hits the File.WriteAllText line telling me that it can't access the file, because it is already in use by another process. What am I not seeing here? Would really appreciate the help!

