Since you added custom code and logic to create the AppPool, you need to add
code to remove the AppPool on uninstall. Application, website, and
Application Pool are all distinct and unrelated entities (other than as
defined for your specific application), so obviously, you need to do the
work to associate them and delete them yourself -- in other words, deleting
a vdir doesn't mean its application pool gets deleted. The application pool
could have been used by some other application (from IIS perspective). IIS
is not MSI, so it does not follow component rules (nor does it make sense),
but your application setup program does need to follow component rules, so
you need to do the right thing.
Otherwise, you need to use a tool like WiX to create the MSI, and it has
CustomAction code that you can declaritively use (without writing code) to
install website, application, and application pool, and its code will do the
right things on install/uninstall without you needing to code anything.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Jeff" <nowhere.RemoveThis@nowhere.com> wrote in message
news:0A450993-F349-42C7-A6A1-6B24A256B114@microsoft.com...
I have a .NET setup / installation project that creates a .NET web site
(Virtual dir) on II6. In the Installer class which gets called from the
Custom Actions, I override the Install method to create an Application Pool
that will be specifically used for the Web site. We decided we wanted to
have
seperate Application Pools dedicated to indiviual Web Applications rather
than having the the 'Default Application' pool controling all the sites.
The setup part works fine. The Vdir gets created, the Web App is installed,
the App Pool gets created, and Virtual Directory gets assigned to the newly
created App Pool. The problem I'm having is in the removal of the Web Site
when the "Add and Remove" program runs when UnInstalling the Web App.
In the setup project, I've set the "RemovePreviousVersions" property to
True. I've over ridden the UnInstall method in the Installer class, and set
a
custom action for the UnInstall property. The problem I'm having is that
when
the Web Site gets removed via the "Add And Remove" program, the Virtual
Directory gets removed, but the Application Pool that was assigned to the
Virtual Directory does NOT get removed.
The OS that hosts the IIS is Windows 2003 Server. I've tried to
programatically to remove the app pool in the UnInstall method of the
Installer class, but the code throws an exception saying it can't do that.
Doing some research, I came across something that said Service Pack 1 is
needed to programatically remove Virtual Dirs and App Pools.
But honestly, I figured I shouldn't have to do anything programatically do
remove the Virtual Dir and the App Pool. I Figured the .NET
Setup/Installation package should handle everything.
Any thoughts would be appreciated. Thanks in advance.