When using a class derived from System.Configuration.Install.Installer in a Visual Studio Web Setup project, actions which modify the IIS metabase should be performed in the Commit method instead of the Install method. The Visual Studio Web Setup project schedules its own metabase modifications after the Install method is called in the custom installer class. It may overwrite metabase changes made earlier in the installation process.
For example, if in the Install method a custom installer creates a web application folder as a subfolder under the TARGETVDIR, it will be deleted after the Install method returns, but before the Commit method is called. (This will only be an issue with IIS 7, since it differentiates between virtual directories and web applications)