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

A peer of mine had an odd IIS error that I was able to fix but couldn't explain the cause of the problem. Here is the background.

There is an IIS sever on Server1 which has a bunch of ASP.Net application under the main website. The main website, the one you get when you go to http:\Sever1, used to be its own ASP.Net application that was associated with the directory C:\MainWebsite. The child ASP.Net applications would then be accessed under http:\Sever1/AppName. The main website now redirects to another sever but the directory was left. When the directory C:\MainWebsite was deleted none of the child ASP.Net website would work giving errors about unable to find this or that .Net type. After restarting IIS a bunch of times and trying to add the dlls for the types it was missing I had him create a new empty directory at C:\MainWebsite and restart IIS. Now all the child websites work.

What is the reason this behavior occured and is there some sort of association I have to break or other trick to allow the 'unneeded' directory C:\MainWebsite to be deleted? Cause someone else may try to delete the folder and start the whole cycle again.

share|improve this question
up vote 0 down vote accepted

I would need more info and would have to explore around on the server to find this one probably. I figure it probably has to do how the 'child' sites are configured, but I don't know of anything specifically that would cause this.

However to answer your last question, you could make it so that directory can't be deleted by changing the security settings. See: How can I make a file trully immutable (non-deletable and read-only)?

share|improve this answer

IIS is usually good about releasing locks, but in the rare occasion it will remain locked. It's possible that the FTP service, another service that came into place, kept a handle on the file.

This won't occur too often, but if you run into it again, use Process Explorer from Search for the file or folder name and it will tell you which application has a handle on that file. You can kill the handle too if you want. Just be really careful about killing handles to files as you can quickly take down a server. Primarily you want to find out which process has the handle, which will give clues as to the reason.

share|improve this answer
I don't think it was a lock as i was able to delete the folder and files without any trouble – Joshua Sep 17 '09 at 13:11

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.