/// <summary>
/// Unregisters the COM types in the specified assembly.
/// </summary>
public static List<System.Type> UnregisterComTypes(string filePath)
{
// load assmebly.
Assembly assembly = Assembly.LoadFrom(filePath);
// check that the correct assembly is being unregistered.
VerifyCodebase(assembly, filePath);
RegistrationServices services = new RegistrationServices();
// list types to register/unregister.
List<System.Type> types = new List<System.Type>(services.GetRegistrableTypesInAssembly(assembly));
// unregister types.
if (!services.UnregisterAssembly(assembly))
{
throw new ApplicationException("Unregister COM Types Failed.");
}
return types;
}