InternalsVisibleToAttribute Class
Assembly: mscorlib (in mscorlib.dll)
'Declaration <AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple:=True, Inherited:=False)> _ Public NotInheritable Class InternalsVisibleToAttribute Inherits Attribute 'Usage Dim instance As InternalsVisibleToAttribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=true, Inherited=false) */ public final class InternalsVisibleToAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=true, Inherited=false) public final class InternalsVisibleToAttribute extends Attribute
Not applicable.
This attribute applies to internal types in C#, friend types in Visual Basic, and all types at namespace or global scope in C++. To apply this attribute to a strong-named friend assembly, you must know the hexadecimal string that represents the public key of the friend assembly. For more information, see How to: Sign an Assembly with a Strong Name.
Do not include values for the CultureInfo, Version, or ProcessorArchitecture fields in the string parameter of the friend assembly declaration. The Visual Basic, C#, and C++ compilers treat this as a compile error. If you use a compiler (such as the MSIL Assembler (Ilasm.exe)) that does not treat it as an error and the assemblies are strong-named, a MethodAccessException is thrown the first time the specified friend assembly accesses the assembly that contains InternalsVisibleToAttribute.
The following example makes types and type members that are marked with the internal keyword in the declaring assembly visible to AssemblyB, to all versions of AssemblyB, and to all variants of AssemblyB that might contain different cultures.
[assembly:InternalsVisibleTo("AssemblyB, PublicKey=32ab4ba45e0a69a1")]
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.