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

后端 未结 20 1647
夕颜
夕颜 2020-12-02 09:32

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

相关标签:
20条回答
  • 2020-12-02 10:01

    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!

    0 讨论(0)
  • 2020-12-02 10:01

    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.

    0 讨论(0)
  • 2020-12-02 10:04

    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".

    0 讨论(0)
  • 2020-12-02 10:04
     Go to run  : ctrl + R
     Type : %temp%
    

    delete All files & folders

     Rebuild Project.
     done!
    
    0 讨论(0)
  • 2020-12-02 10:05

    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.

    0 讨论(0)
  • 2020-12-02 10:05

    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.

    0 讨论(0)
提交回复
热议问题