[Mono-dev] Wrong return value for RegistryKey.ToString(): Reason? or Can I fix?

Robert Jordan robertj at gmx.net
Mon Feb 25 16:49:28 EST 2008


Justin Cherniak wrote:
> For some reason RegistryKey.ToString() on Mono does not produce the same
> value as on .NET.  When running a program under windows, Mono returns the
> keyname + a handle value when calling ToString().  Under .NET, it just
> returns the keyname.  I looked through the source and the offending line
> seems to be:
>             IntPtr handle = GetHandle(rkey);
>             return String.Format("{0} [0x{1:X}]", rkey.Name, handle.ToInt32
> ());
> 
> I'm just curious if there is a reason for this or if I can commit a fix.  I
> think its worth noting that UnixRegistryApi returns the "proper" value, so
> I'm unclear why the windows implementation would not.

It's for MS.NET 1.1 compatibility.

Robert



More information about the Mono-devel-list mailing list