IIS 7 unable to load DLL (Access Denied)

I'm having this weird problem with IIS 7 on Windows 7, where it can't load a dll I'm using. However, it seems to only happen after a while; it works fine for some random amount of time until it starts throwing this message:

Could not load file or assembly 'Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. Access is denied.

If I delete the dll and re-add it, it works fine for another length of time, and later stops working again. This is happening in both an asp.net webpage as well as a web service, however in a normal .net desktop program it works fine.

This only happens with Mono.Security, not with any other dll I'm using (I'm using Npgsql which is dependent on Mono.Security).

If anyone could offer some insight into this, it would be great.


Check file permissions on the DLL file / folder, to make sure your ASP.NET AppPool account can access the file.

Make sure the file's permissions don't inherit from parent - something might be resetting these.


Perhaps you are performing a backup during those times? Just a shot in the dark... Also, in your web.config you don't need to define the version, culture, or public key in order to use the assembly.. Maybe that has something to do with it.

链接地址: http://www.djcxy.com/p/54378.html

上一篇: 我如何确定方法所需的最低可见度?

下一篇: IIS 7无法加载DLL(拒绝访问)