﻿<?xml version="1.0" encoding="utf-8"?><Type Name="InternalsVisibleToAttribute" FullName="System.Runtime.CompilerServices.InternalsVisibleToAttribute"><TypeSignature Language="C#" Value="public sealed class InternalsVisibleToAttribute : Attribute" /><TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit InternalsVisibleToAttribute extends System.Attribute" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>System.Attribute</BaseTypeName></Base><Interfaces /><Attributes><Attribute><AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)</AttributeName></Attribute></Attributes><Docs><since version=".NET 2.0" /><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Ordinarily, types and members with internal scope (in C#) and friend scope (in Visual Basic) are visible only in the assembly in which they are defined. The <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute" /> attribute makes them also visible to the types in a specified assembly, which is known as a friend assembly.</para><para>The attribute is applied at the assembly level. This means that it can be included at the beginning of a source code file, or it can be included in the AssemblyInfo file in a Visual Studio project. You can use the attribute to specify a single friend assembly that can access the internal types and members of the current assembly. You can define multiple friend assemblies in two ways. They can appear as individual assembly-level attributes, as the following example illustrates.</para><para>code reference: System.Runtime.CompilerServices.InternalsVisibleToAttribute#3</para><para>They can also appear with separate <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute" /> tags but a single assembly keyword, as the following example illustrates.</para><para>code reference: System.Runtime.CompilerServices.InternalsVisibleToAttribute#4</para><para>The friend assembly is identified by the <see cref="M:System.Runtime.CompilerServices.InternalsVisibleToAttribute.#ctor(System.String)" /> constructor. Both the current assembly and the friend assembly must be unsigned, or both assemblies must be signed with a strong name. If they are signed with a strong name, the argument to the <see cref="M:System.Runtime.CompilerServices.InternalsVisibleToAttribute.#ctor(System.String)" /> constructor must include the full public key as well as the name of the assembly. For more information about using <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute" /> with strong-named assemblies, see the <see cref="M:System.Runtime.CompilerServices.InternalsVisibleToAttribute.#ctor(System.String)" /> constructor.</para><para>Do not include values for the <see cref="P:System.Reflection.AssemblyName.CultureInfo" />, <see cref="P:System.Reflection.AssemblyName.Version" />, or <see cref="P:System.Reflection.AssemblyName.ProcessorArchitecture" /> field in the argument; the Visual Basic, C#, and C++ compilers treat this as a compiler error. If you use a compiler that does not treat it as an error (such as the <format type="text/html"><a href="4ca3a4f0-4400-47ce-8936-8e219961c76f">MSIL Assembler (ILAsm.exe)</a></format>) and the assemblies are strong-named, a <see cref="T:System.MethodAccessException" /> exception is thrown the first time the specified friend assembly accesses the assembly that contains the <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute" /> attribute.</para><para>If you use the C# compiler to compile the friend assembly, you must explicitly specify the name of the output file (.exe or .dll) by using the /out compiler option. This is required because the compiler has not yet generated the name for the assembly it is building at the time it is binding to external references. The /out compiler option is optional for the Visual Basic compiler, and the corresponding --out or –o compiler option should not be used when compiling friend assemblies with the F# compiler.</para><para>For more information about how to use this attribute, see the following topics:</para><list type="bullet"><item><para><format type="text/html"><a href="8d55fee0-b7c2-4fbe-a23b-dfe424dc71cd">Friend Assemblies (C++)</a></format></para></item><item><para><format type="text/html"><a href="df0c70ea-2c2a-4bdc-9526-df951ad2d055">Friend Assemblies (C# and Visual Basic)</a></format></para></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public InternalsVisibleToAttribute (string assemblyName);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string assemblyName) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="assemblyName" Type="System.String" /></Parameters><Docs><since version=".NET 2.0" /><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The <see cref="M:System.Runtime.CompilerServices.InternalsVisibleToAttribute.#ctor(System.String)" /> constructor defines a friend assembly, which is an assembly that has access to the internal types and members of the current assembly. </para><para>Both the current assembly and the friend assembly must be unsigned, or both must be signed with a strong name. (For more information about strong-named assemblies, see <format type="text/html"><a href="ffbf6d9e-4a88-4a8a-9645-4ce0ee1ee5f9">Creating and Using Strong-Named Assemblies</a></format>.) If both are unsigned, the <paramref name="assemblyName" /> parameter consists of the name of the friend assembly, specified without a directory path or file extension. If both are signed, <paramref name="assemblyName" /> consists of the name of the friend assembly along with its full public key (but not its public key token). The other components of a strong name, such as those that provide culture, version, or processor architecture information, cannot be specified in the <paramref name="assemblyName" /> parameter.</para><para>You can use <format type="text/html"><a href="c1d2b532-1b8e-4c7a-8ac5-53b801135ec6">Sn.exe (Strong Name Tool)</a></format> to retrieve the full public key from a strong-named key (.snk) file. To do this, you perform the following steps:</para><list type="ordered"><item><para>Extract the public key from the strong-named key file to a separate file:</para><para><system>Sn -p</system> snk_file outfile</para></item><item><para>Display the full public key to the console:</para><para><system>Sn -tp</system> outfile</para></item><item><para>Copy and paste the full public key value into your source code.</para></item></list><para>For more information about how to use the <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute" /> attribute, see the following topics:</para><list type="bullet"><item><para><format type="text/html"><a href="8d55fee0-b7c2-4fbe-a23b-dfe424dc71cd">Friend Assemblies (C++)</a></format></para></item><item><para><format type="text/html"><a href="df0c70ea-2c2a-4bdc-9526-df951ad2d055">Friend Assemblies (C# Programmer's Reference)</a></format></para></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute" /> class with the name of the specified friend assembly. </para></summary><param name="assemblyName"><attribution license="cc4" from="Microsoft" modified="false" />The name of a friend assembly.</param></Docs></Member><Member MemberName="AllInternalsVisible"><MemberSignature Language="C#" Value="public bool AllInternalsVisible { get; set; }" /><MemberSignature Language="ILAsm" Value=".property instance bool AllInternalsVisible" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>This property is not implemented.</para></summary></Docs></Member><Member MemberName="AssemblyName"><MemberSignature Language="C#" Value="public string AssemblyName { get; }" /><MemberSignature Language="ILAsm" Value=".property instance string AssemblyName" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.String</ReturnType></ReturnValue><Docs><value>To be added.</value><since version=".NET 2.0" /><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>For more information about how to use the <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute" /> attribute, see the following topics:</para><list type="bullet"><item><para><format type="text/html"><a href="8d55fee0-b7c2-4fbe-a23b-dfe424dc71cd">Friend Assemblies (C++)</a></format></para></item><item><para><format type="text/html"><a href="df0c70ea-2c2a-4bdc-9526-df951ad2d055">Friend Assemblies (C# Programmer's Reference)</a></format></para></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the name of the friend assembly to which all types and type members that are marked with the internal keyword are to be made visible. </para></summary></Docs></Member></Members></Type>