System.IO.File.WriteAllBytes(NetworkPath, Encoding.UTF8.GetBytes(stringBuilder.ToString()));
When running this code in Visual Studio, I get Access Denied.
However if I navigate to Network Path with File Explorer, I can right click and create Files and Folders with the same User account that is running Visual Studio 2019 and the code above.