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 1650
夕颜
夕颜 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:06

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

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

    I believe I wasted like 1 day on researching it and this what I have come out with.

    You need to add the Impersonating user to the Debug folder of your Solution as the Framework will try to access the DLL from this location and place it in Temporary Asp.Net Folder.

    So basically follow these 2 steps

    1. Give permission to Temporary Asp.Net Folder under C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files and make sure the user you are adding here is the same you are using while Impersonating.

    2. Add the Impersonating user to the Debug folder of your Solution YourSolutionPath .. \bin\Debug

    This should work

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

    In my case, I had copied a service from one server to another without performing a proper deployment from Visual Studio. Long story.

    Anyway, I had setup all of the appropriate NTFS permissions and whatnot, but it still couldn't load the main DLL for the service.

    I fixed it by renaming the corresponding service.pdb file to something else.

    For example here's my bin folder: \bin\ service.dll service.dll.config service.pdb I renamed service.pdb to zzservice.pdb, and then the service.dll loaded fine.

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

    In my case, I was using simple impersonation and the impersonation user had trouble accessing one of the project assemblies. My solution:

    1. Look for the message of the inner exception to identify the problematic assembly.
    2. Modify the security properties of the assembly file.

      a) Add the user account you're using for impersonation to the Group and user names.

      b) Give that user account full access to the assembly file.

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

    I am setting-up environment on new server. My web.config got identity node like below.When I faced with "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"

    Added ccs\HJKWeb as users list of my new server.

      <authentication mode="Windows" />
            <identity impersonate="true" password="******" userName="ccs\HJKWeb" />
    
    0 讨论(0)
  • 2020-12-02 10:18

    If you get the DLL could not be found instead of access denied, make sure you have the appropriate VC++ Redistributable installed.

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