Why am I getting Access Denied when writing files to a network path when my user account can create files

125 views Asked by At
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.

0

There are 0 answers