I'm having a similar problem as this unanswered question: https://stackoverflow.com/questions/15766589/objectguid-from-active-directory-returns-only-one-part-of-the-array
Reading the "objectGUID" property from Active Directory works fine in Windows, but on Mono I cannot make sense of the return value.
Using C# on Windows, .NET Framework 4, 64-bit architecture, the type comes back as System.Byte[] which is easily converted to Guid. This is the raw data that is returned:
00000000h: 52 09 11 26 50 D2 5F 40 B0 DC 0C A7 06 4C E8 27
However on Mono 3.2.5, Ubuntu 13.10, 64-bit architecture, the type comes back as System.String. This is the raw data that is returned:
00000000h: 52 09 11 26 50 EF BF BD 5F 40 EF BF BD EF BF BD
00000010h: 0C EF BF BD 06 4C EF BF BD 27
I'm seeing a pattern with the EF BF BD sequence...
Another way I was able to look at it was to display the actual byte sequence (converting each char to Int32 on mono) producing this telling output: (Windows on the left, Mono on the right)
Win Mono
---- ----
82 82
9 9
17 17
38 38
80 80
210 65533
95 95
64 64
176 65533
220 65533
12 12
167 65533
6 6
76 76
232 65533
39 39
Notice how anytime the number is >=100-ish on the left, it is converted to 65533 on the right? Fact: byte.MaxValue is 255 Fact: The hexadecimal number 100 is equal to the decimal number 256 (1 higher than byte.MaxValue) Fact The decimal number 100 is equal to the hexadecimal number 64 Don't know if any of that is related...
I feel like the data is there, I just cannot figure out how to get at it. Or maybe this is simply a Mono bug and the data is and always will be totally corrupted.
Any thoughts?