BUG - Deleting VD Application does not delete location configurationRSS

1 reply

Last post May 14, 2016 07:21 AM by lextm

  • BUG - Deleting VD Application does not delete location configuration

    May 13, 2016 07:30 AM|aj187|LINK

    Version: IIS 7.5 Windows 2008 R2


    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.


    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.


    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.

  • Re: BUG - Deleting VD Application does not delete location configuration

    May 14, 2016 07:21 AM|lextm|LINK

    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.

    Lex Li
    IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    This posting is provided "AS IS" with no warranties, and confers no rights.