Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a webservice running on IIS written in c#.

Lately we've been having this Could not load file or assembly "mycustomlibrary.dll". Access is denied.

It doesn't happen every time on the same assembly. Any pointers to where to look?

share|improve this question

There are a lot of things that can throw an access denied error, sometimes it doesn't have anything to do with permissions at all.

So, we're going to need more information, such as;

  • Where is this file located?
  • Does the IIS User have access to read & execute this file?
  • What version of IIS are you running (and what version of Windows)
  • What is this library attempting to do (it may require to run with elevated privelages of some sort for certain operations if it isn't already).
share|improve this answer
the file .. is a dll. I believe it's in the bin Where do I see the IIS User account? IIS 6.0 It's happening in different libraries, some library will just try to build an object from the external libraries. Some tries to communicate with a wcf service. It's seem so random. Is there tools I can use to check the permission or to see on what credential the web request is being made? – GoDaddy Apr 26 '10 at 20:40
@GiDaddy - You "believe it's in the bin..."? How can you expect to get this right if you don't even KNOW where the file is? – John Gardeniers Apr 26 '10 at 21:50
Sorry, it's my bad habit to talk like that. We found the problem related to impersonation. Some call on the webservice where impersonnated and they did not had some priviledges to some temporary asp .net folder. – GoDaddy Apr 27 '10 at 13:29
up vote 1 down vote accepted

Found the issue was related to impersonation. Some calls where impersonated and the impersonated user did not have rights to %SystemRoot%\Microsoft.NET\Framework\versionNumber\Temporary ASP.NET Files

here are more details on ACL

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.