locked
BUG - Deleting VD Application does not delete location configuration RRS feed

  • Question

  • User-1737487392 posted

    Version: IIS 7.5 Windows 2008 R2

    Background:

    When you create a virtual directory application under a site, setup configuration on it such as changing authentication modes, setting sslflags, etc, it creates an entry in the applicaitonhost.config file for this under a location tag for your site.

    Issue:

    Under normal circumstance, when you delete the Virtual directory application, it also deletes all site specific configuration for it (EG: Deletes the location tag and all settings in it for the site you deleted).

    However, when the root site that your virtual directory is under has a directory with the exact same name as your virtual directory application, the config will not get deleted.

    EG: 

    IIS: IIS:\Sites\Services - Root Website -Physical Path: F\Services
    IIS: IIS:\Sites\Services\MySpecificService -VD Application -Physical Path F:\Services\MySpecificService

    When deleting this virtual directory application, since a folder with the exact same name is under the root sites (IIS:\Sites\Services) physical path (F:\Services contains MySpecificService Directory), it will not delete the location specific configuration.

    This causes issues if a site with the same name is created in the same location as it will now have the config of the previous site whose config never got deleted when the site did.

    Friday, May 13, 2016 7:30 AM

All replies

  • User690216013 posted

    Before removing a virtual directory from IIS configuration via MWA, you should use your code to manipulate the mapped physical directory (delete it or keep it as it is depending on your situation).

    MWA only modifies IIS configuration files, which is not a bug in my eyes. That design makes sense as you do need to take care of the physical files on your own.

    Saturday, May 14, 2016 7:21 AM