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

I was getting an error today complaining about loading one of the assemblies in my web service.

I spent hours adding all sorts of security privildges to the folders in windows and in IIS.

initially I had the dll name in my google search, this lead me down completely the wrong path, finally I typed in the text in the title of this blog post

In the end the problem turned out to be permission on temporary ASP.NET folder and I finally found this article on how to set permission for the Temporary ASP.NET folder, which you can read here

To assign write permissions to the Temporary ASP.NET folder

  1. Click Start, click Run, type explorer, and then click OK.
  2. In Windows Explorer, move to the <drive:>\Windows\Microsoft.NET\Framework\v2.0.50727 (or <drive:>\WinNT\Microsoft.NET\Framework\v2.0.50727, where appropriate) folder.
  3. Right-click Temporary ASP.NET Files, and then click Properties.
  4. In the Temporary ASP.NET Files Properties dialog box, on the Security tab, click Add.
  5. In the Enter the object names to select text box, type <Domain or Computer name>\RunTimeUser, and then click OK.
    As appropriate, substitute the user name for the anonymous user account you created for “RunTimeUser”.
  6. In the Temporary ASP.NET Files Properties dialog box, in the Groups or user names list, select the RunTimeUser account.
  7. In the Permissions for RunTimeUser list, select Write in the Allow column. (Read & Execute and Read should already be selected in the Allow column Click OK.
  8. In the Security dialog box, click Yes.
  9. Repeat steps 3 through 8 for the Web service accounts: CatalogWebSvc, MarketingWebSvc, OrdersWebSvc, and ProfilesWebSvc.

2 thoughts on “Could not load file or assembly or one of its dependencies. Access is denied.

  1. Panglima Pejuang November 7, 2011 / 4:30 am

    As my experience to solve this problem is: give the access to folder “Temporary ASP.NET”
    exist in : “C:\Windows\Microsoft.NET\Framework\v2.0.50727”

    Right click folder –> properties –> Security tab –> Add “NETWORK SERVICE” –> give Modify access or full control.

    and try make some crm transaction.., if still error , try to :
    1. iis reset ….
    2. open control panel –> IIS manager –> expand Server name node –> click “Application Pools” –> high-light the “CRMAppPool” –> click “Recycle”


  2. myfavoritelines December 19, 2011 / 3:33 pm


    Just one addition to this: I fell foul of the fact that the temporary folder was under Framework64 and not Framework – so watch out!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s