Error : Could not load file or assembly or one of its dependencies. Access is denied.

In case of web application if this error occurs, it means ASPNET account(for WindowsXP machine) or NETWORK SERVICE account (for Vista and Windows 2003 machine), does not have reqiured permissions(read/write) on the "%systemroot%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" folder.These are less privileged accounts used by web server to process the web request.
Actually aspnet_wp.exe worker process in IIS5 runs under ASPNET account to provide security against potential hacking.

It is shown in the user account list also whereas NETWORK SERVICE does not show up in it but rather is shown in the Security tab of the resources (like a folder) as a User Name like ASPNET that can be assigned permissoins. For that you need to do following steps:

1. right click on the folder, then
2. click on "Sharing and Security", then
3. click on "Security"
4. click on the "Add" button
5. click on "Advanced"
6. click on "Find Now"
7. Scroll down until you find "NETWORK SERVICE"

So follow above given steps go give permission(read/write) to ASPNET or NETWORK SERVICE account depending upon your OS on "%systemroot%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" folder.

No comments: