IIS7 – Removing Phantom Applications from Application Pools

application-poolsiisiis-7

I have an application in one of my application pools that has a virtual path of /Site/login.aspx. I want to remove it but it no longer exists on my computer and it's causing me issues setting up AppFabric.

I understand that you can remove these phantom applications by recreating the application in IIS and then hitting Remove. That will get rid of the application from the pool but in this case I can't recreate the application due to the /login.aspx in the virtual path

Any ideas how I remove this erroneous entry?

Best Answer

Since I had the same issue; application pools with applications that did not exist anymore, I did some research and finally managed to solve the issue.

Here are some steps:

  1. Locate and edit your IIS 7 configuration file "applicationHost.config" with a text editor. It should be stored in "C:\windows\system32\inetsrv\config" Since the folder is somehow "protected", I usually edit like the following:
    1. Open Windows Explorer
    2. Navigate to "C:\windows\system32\inetsrv\config"
    3. Copy the file "applicationHost.config"
    4. Paste it to a folder where you can edit it, e.g. your Desktop
    5. Open it with your editor of choise and edit it
    6. Copy it back with Windows Explorer to "C:\windows\system32\inetsrv\config"
  2. Make a backup of your "applicationHost.config" file!
  3. Search with a text editor in your "applicationHost.config" for your non-existing applications. They should be located somewhere inside an <application ...> XML node.
  4. Delete the <application ...> node(s) of all your phantom applications.
  5. Save the file and copy it back to "C:\windows\system32\inetsrv\config"
  6. Refresh the IIS management console. Your application pools should now be without the phantom applications you previously deleted.
  7. Actually remove the now empty application pool.

That worked for me, if it does not work for you, please post a comment here. A good help was this posting on the IIS forum.

Please be also aware that when editing the "applicationHost.config" file directly in its original location, you need to use a 64-bit editor (e.g. Notepad++ 64-bit), because otherwise it would get stored in "C:\Windows\SysWOW64\inetsrv\Config" instead of the correct location.