Could not load file or assembly or one of its dependencies. Access is denied. The issue is random, but after it happens once, it continues

Solution 1:

For my scenario, I found that there was a identity node in the web.config file.

<identity impersonate="true" userName="blah" password="blah">

When I removed the userName and password parameters from node, it started working.

Another option might be that you need to make sure that the specified userName has access to work with those "Temporary ASP.NET Files" folders found in the various C:\Windows\Microsoft.NET\Framework{version} folders.

Hoping this helps someone else out!

Solution 2:

Had the same issue, fixed with setting the parameter "Enable 32-bit applications" to "true" (in advanced settings of iis application pool).