Home All Groups Group Topic Archive Search About

PublicKey of System.Xml assembly

Author
21 Aug 2006 6:57 PM
Manoj Agarwal
I need to make some classes in my assembly internal. I am using XMLSerializer
to serialize the objects of my classes. XMLSerializer cannot access my
internal classes. So I am thinking that adding System.Xml as a friend would
make my internal classes visible to XMLSerializer.

Adding System.Xml as a friend requires public key of the System.Xml assembly
specified. I can get the PublicKeyToken, but not the public key. I tried
following code also but no luck, it just returns 16 bytes (0000000040000000).

Assembly assembly = Assembly.GetAssembly(

typeof(System.Xml.Serialization.XmlSerializer));
byte[] pubkey = assembly.GetName().GetPublicKey();


Any ideas to get the public key of System.Xml assembly, it doesn't have to
be programatically.

Thanks!

Author
21 Aug 2006 7:46 PM
Manoj Agarwal
It turns out that "0000000040000000" is in fact the public key for System.Xml.


Show quote
"Manoj Agarwal" wrote:

> I need to make some classes in my assembly internal. I am using XMLSerializer
> to serialize the objects of my classes. XMLSerializer cannot access my
> internal classes. So I am thinking that adding System.Xml as a friend would
> make my internal classes visible to XMLSerializer.
>
> Adding System.Xml as a friend requires public key of the System.Xml assembly
> specified. I can get the PublicKeyToken, but not the public key. I tried
> following code also but no luck, it just returns 16 bytes (0000000040000000).
>
> Assembly assembly = Assembly.GetAssembly(
>                                          
> typeof(System.Xml.Serialization.XmlSerializer));
> byte[] pubkey = assembly.GetName().GetPublicKey();
>
>
> Any ideas to get the public key of System.Xml assembly, it doesn't have to
> be programatically.
>
> Thanks!

AddThis Social Bookmark Button