Try using `Path.Combine` here over manual concatenation. I wonder if Linux/Mac will run into the same issue again with the `file.LastIndexOf('\\')`.