Mono Class Library: System.Runtime.CompilerServices Namespace

System.Runtime.CompilerServices.InternalsVisibleToAttribute Class

This attribute is used to expose internal methods to another assembly. [Edit]

See Also: InternalsVisibleToAttribute Members

System.Object
     System.Attribute
          System.Runtime.CompilerServices.InternalsVisibleToAttribute

[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
public sealed class InternalsVisibleToAttribute : Attribute

Remarks

This is an assembly-level attribute that is used to expose the internal types and members to another assembly. This makes everything that might have been flagged as "internal" visible as a public member to the assembly referenced.

If you have a public key (the .pub file used to sign an assembly): use the following command to extract the Public Key):

Shell Inovcation Example
mono$ sn -tp /cvs/moon/class/silverlight.pub 
Mono StrongName - version 1.9.0.0
StrongName utility for signing assemblies
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.

Public Key:
00240000048000009400000006020000002400005253413100040000010001008d56c76f9e8649
383049f383c44be0ec204181822a6c31cf5eb7ef486944d032188ea1d3920763712ccb12d75fb7
7e9811149e6148e5d32fbaab37611c1878ddc19e20ef135d0cb2cff2bfec3d115810c3d9069638
fe4be215dbf795861920e5ab6f7db2e2ceef136ac23d5dd2bf031700aec232f6c6b1c785b4305c
123b37ab

Public Key Token: 7cec85d7bea7798e
  

Use this key then as the PublicKey value inside the string:

C# Example
// This attribute makes the internal methods available to the Mono.Moonlight assembly.
[assembly: InternalsVisibleTo ("Mono.Moonlight, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c913
4474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef00
65d016df")]
  
[Edit]

Requirements

Namespace: System.Runtime.CompilerServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0