I am getting this error when calling a web service method which writes to a file on the local drive on Windows 2003.
\"System.Security.SecurityException: Request for the
Finally we have found the issue. After building the files in Windows we put them in a zip file. When the files are added to the zip windows adds a blocking property to all files which remains after unzipping the folder. These caused the files to not be able to run properly. The "block" property can be removed by right-clicking on the files (one at the time), select "Properties" and then clicking the "Unblock" button at the bottom. Here is an example picture:
https://www.howtogeek.com/wp-content/uploads/2011/08/image10.png
To prevent windows from adding this blocking property, one can look at the following thread:
Can I stop windows from “Blocking” zip files
After a lot of troubleshooting, it boiled down to a mistake I made in web.config where the location tag had a path of www.example.com but in IIS it was example.com!