private static void ComUnregister(Type t) { string keyPath = String.Format(@"SOFTWARE\SolidWorks\AddIns\{0:b}", t.GUID); Microsoft.Win32.Registry.LocalMachine.DeleteSubKeyTree(keyPath); }