This documentation is archived and is not being maintained.

InternalsVisibleToAttribute Constructor

Note: This constructor is new in the .NET Framework version 2.0.

Initializes a new instance of the InternalsVisibleToAttribute class with the name of the specified friend assembly.

Namespace: System.Runtime.CompilerServices
Assembly: mscorlib (in mscorlib.dll)

Public Sub New ( _
	assemblyName As String _
Dim assemblyName As String

Dim instance As New InternalsVisibleToAttribute(assemblyName)
public InternalsVisibleToAttribute (
	String assemblyName
public function InternalsVisibleToAttribute (
	assemblyName : String



The name of a friend assembly to which all nonpublic types are to be made visible.

Apply this attribute at the assembly level to specify that all nonpublic types in that assembly are visible to another assembly. For more information, see Friend Assemblies (C# Programming Guide) or Friend Assemblies. To apply this attribute to a strong-named assembly, you must know the hexadecimal string that represents the public key of the friend assembly.

The following code example makes nonpublic types in the declaring assembly visible to AssemblyB, to all versions of AssemblyB, and to all variants of AssemblyB that might contain different cultures.

[assembly:InternalsVisibleToAttribute("AssemblyB, PublicKey=32ab4ba45e0a69a1")]

Windows 98, Windows 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

.NET Compact Framework

Supported in: 2.0