A
aaronfude
Hi,
I have the following code (from a project I found on the web) that
deletes a subkey.
RegistryKey root = Registry.ClassesRoot;
root.DeleteSubKey("AllFilesystemObjects\\shellex\\ContextMenuHandlers\\CleanVS");
It throws the following exception:
Void DeleteSubKey(System.String, Boolean)
System.ArgumentException: Cannot delete a subkey tree because the
subkey does not exist.
at Microsoft.Win32.RegistryKey.DeleteSubKey(String subkey, Boolean
throwOnMis
singSubKey)
at Microsoft.Win32.RegistryKey.DeleteSubKey(String subkey)
at CleanVS.CleanVS.UnregisterServer(String zRegKey)
I checked manually that the subkey does exist, and in fact it gets
deleted during this operation! ...But I still get the error! Any
ideas?!
By the way, the key was created with this command:
root = Registry.ClassesRoot;
rk =
root.CreateSubKey("AllFilesystemObjects\\shellex\\ContextMenuHandlers\\CleanVS");
rk.SetValue("", clsid);
rk.Close();
Very many thanks in advance!
I have the following code (from a project I found on the web) that
deletes a subkey.
RegistryKey root = Registry.ClassesRoot;
root.DeleteSubKey("AllFilesystemObjects\\shellex\\ContextMenuHandlers\\CleanVS");
It throws the following exception:
Void DeleteSubKey(System.String, Boolean)
System.ArgumentException: Cannot delete a subkey tree because the
subkey does not exist.
at Microsoft.Win32.RegistryKey.DeleteSubKey(String subkey, Boolean
throwOnMis
singSubKey)
at Microsoft.Win32.RegistryKey.DeleteSubKey(String subkey)
at CleanVS.CleanVS.UnregisterServer(String zRegKey)
I checked manually that the subkey does exist, and in fact it gets
deleted during this operation! ...But I still get the error! Any
ideas?!
By the way, the key was created with this command:
root = Registry.ClassesRoot;
rk =
root.CreateSubKey("AllFilesystemObjects\\shellex\\ContextMenuHandlers\\CleanVS");
rk.SetValue("", clsid);
rk.Close();
Very many thanks in advance!