[Mono-bugs] [Bug 77772][Maj] New - UnixRegistryApi.DeleteValue throwing exception

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Mar 12 14:38:14 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bugzilla at cornetdesign.com.

http://bugzilla.ximian.com/show_bug.cgi?id=77772

--- shadow/77772	2006-03-12 14:38:14.000000000 -0500
+++ shadow/77772.tmp.23249	2006-03-12 14:38:14.000000000 -0500
@@ -0,0 +1,70 @@
+Bug#: 77772
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Gentoo 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: bugzilla at cornetdesign.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: UnixRegistryApi.DeleteValue throwing exception
+
+Here is the original email. This is blocking the tests for NUnit from
+running on Mono/Linux because of the error being thrown.
+
+Cory:
+
+--------------------------
+
+Hi All,
+
+I'm building NUnit on Linux with the latest version of Mono (.14) and am
+getting the following:
+
+     [exec] 5) NUnit.Util.Tests.NUnitRegistryTests.TestClearRoutines :
+System.InvalidCastException : Cannot cast from source type to destination type.
+     [exec] in <0x00095> Microsoft.Win32.UnixRegistryApi:DeleteValue
+(Microsoft.Win32.RegistryKey rkey, System.String value, Boolean
+throw_if_missing)
+     [exec] in <0x00038> Microsoft.Win32.RegistryKey:DeleteValue
+(System.String value, Boolean shouldThrowWhenKeyMissing)
+     [exec] in <0x0000f> Microsoft.Win32.RegistryKey:DeleteValue
+(System.String value)
+     [exec] in (wrapper remoting-invoke-with-check)
+Microsoft.Win32.RegistryKey:DeleteValue (string)
+     [exec] in <0x00070> NUnit.Util.NUnitRegistry:ClearKey
+(Microsoft.Win32.RegistryKey key)
+     [exec] in <0x00030> NUnit.Util.NUnitRegistry:ClearSubKey
+(Microsoft.Win32.RegistryKey baseKey, System.String subKey)
+     [exec] in <0x00023> NUnit.Util.NUnitRegistry:ClearTestKeys ()
+     [exec] in <0x00139>
+NUnit.Util.Tests.NUnitRegistryTests:TestClearRoutines ()
+     [exec] in <0x00000> <unknown method>
+     [exec] in (wrapper managed-to-native)
+System.Reflection.MonoMethod:InternalInvoke (object,object[])
+     [exec] in <0x0008d> System.Reflection.MonoMethod:Invoke (System.Object
+obj, BindingFlags invokeAttr, System.Reflection.Binder binder,
+System.Object[] parameters, System.Globalization.CultureInfo culture)
+
+The code is pretty straightforward:
+
+public static void ClearKey( RegistryKey key )
+{
+    foreach( string name in key.GetValueNames() )
+        key.DeleteValue( name );
+     foreach( string name in key.GetSubKeyNames() )
+        key.DeleteSubKeyTree( name );
+}
+
+
+Does this look to you all to be a bug in the UnixRegistryApi, or something
+innocuous like an invalid name? The code that is calling ClearKey verifies
+that the RegistryKey it is passing in isn't null. Any pointers would be
+appreciated. Thanks!


More information about the mono-bugs mailing list