I have found plenty of information out there about this error: \'ERROR: Could not load file or assembly \'*.dll\' or one of its dependencies. Access is denied.’ But i haven
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!
My solution is as follows:
I didn't find a root folder under C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
.
Google told me that it might be a permission issue against current user, then I found I have a current Identity: IIS APPPOOL
in the malfunctioning server where the rest of the server has Current Identity: NT AUTHORITY\NETWORK SERVICE
.
Then I changed Current Identity from IIS APPPOOL
to NT AUTHORITY\NETWORK SERVICE
.
From here, I found that resetting the web app rebuilds the temporary ASP.NET cache, solving the issue.
I was not using impersonation in my case. My solution was to give full access to my project directory for the user group "IIS_IUSRS".
Go to run : ctrl + R
Type : %temp%
delete All files & folders
Rebuild Project.
done!
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.
Check the IIS settings. I use IIS 7.5 with 32 or 64 bit compilation within the .NET framework. If you have an app that uses 32-bit mode, make sure to enable the App Pool to be able to use 32-bit instruction. Otherwise, nothing seems to work no matter how much you set the security or strong sign the DLL.