If you're using impersonation. The answer is to give permission for the user that you're impersonating access to the following folders :
C:\Windows\Microsoft.NET\Framework[v4.0.30319 or the version that you're using]\Temporary ASP.NET Files
Your site directory.
also you might need to create folder as the following :
C:\Windows\Microsoft.NET\Framework\[v4.0.30319 or the version that you're using]\Temporary ASP.NET Files\[Application-Name-Goes-Here]
But try the previous first, it worked for me.
Those two changes for granting the impersonated user permission to be able to save the temp data, and pull the dll files, and any needed files from the directories
Update, For windows 10 This is the solution that worked for me
We will do both steps, but Instead of
C:\Windows\Microsoft.NET\Framework[v4.0.30319 or the version that you're using]\Temporary ASP.NET Files
Write %TEMP% into the file explorer, and give permission for the user that you're impersonating access to the following folder:
C:\Users\[UserName]\AppData\Local\Temp\Temporary ASP.NET Files