If you are using impersonation, be sure to give permissions, including write and modify permission to the relevant user account on the following folder:
C:\Users\[username]\AppData\Local\Temp\Temporary ASP.NET Files
I was missing the modify permission, which was why just adding the default permissions wasn't working for me.