I tend to create a lot of test web sites and applications in Visual Studio for learning purposes. Now I have ended up hosting many unused sites in IIS Express. Let’s clean up them.
1. Where is the configuration?
Unlike IIS, IIS Express does not have UI to view and configure sites and settings. You can directly access the configuration file.
You can find the <sites> section in the file. But it is not recommended to modify the file directly.
Fortunately, you can use the command line tool “appcmd.exe“.
It is located in the “C:\Program Files (x86)\IIS Express” folder.
3. Viewing the List of Sites
You can see the list of sites:
> appcmd list site
Or you can see the virtual directories
> appcmd list vdir
4. Renaming the Site
One way to clean up the site is to rename it.
> appcmd set site WebSite(1) -name:MySite
5. Delete the Site
You can remove the unused site completely.
> appcmd delete site WebSite(1)