How to write to a file with C# in 2019 - StackOverflow doesn't get it right