Removing phantom applications from Application Pools in IIS7
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?
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:
- 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:
- Open Windows Explorer
- Navigate to "C:\windows\system32\inetsrv\config"
- Copy the file "applicationHost.config"
- Paste it to a folder where you can edit it, e.g. your Desktop
- Open it with your editor of choise and edit it
- Copy it back with Windows Explorer to "C:\windows\system32\inetsrv\config"
- Make a backup of your "applicationHost.config" file!
- Search with a text editor in your "applicationHost.config" for your non-existing applications. They should be located somewhere inside an
<application ...>
XML node. - Delete the
<application ...>
node(s) of all your phantom applications. - Save the file and copy it back to "C:\windows\system32\inetsrv\config"
- Refresh the IIS management console. Your application pools should now be without the phantom applications you previously deleted.
- 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.
This is probably safer and simpler than editing applicationHost.config.
Powershell
PS C:\Windows\system32> import-module WebAdministration
PS C:\Windows\system32> iis:
PS IIS:\> cd .\AppPools
PS IIS:\AppPools> ls
PS IIS:\AppPools> del [name of phantom AppPool]