The IWamAdmin::AppUnload method unloads a Web application that is running out-of-process. All of the application's resources are released, and the application's process is terminated. If the application is running in-process, the application resource is released if it is not being referenced by any other in-process applications.
Note Server component DLLs are not released from in-process applications, even if they aren't currently referenced by other applications.
HRESULT STDMETHODCALLTYPE AppUnLoad(
LPCWSTR szMDPath,
BOOL fRecursive
);
The method will return NO_ERROR if the method succeeded, even if no application was defined at the specified path, or the application is not running. If the method fails, other error codes converted to an HRESULT will be returned.