You can use the InternalsVisibleToAttribute attribute to identify one or more friend assemblies for a given assembly. The following example uses the InternalsVisibleToAttribute attribute in assembly A and specifies assembly AssemblyB as a friend assembly. This gives assembly AssemblyB access to all types and members in assembly A that are marked as Friend (Visual Basic) or internal (C#).
Taken from msdn
You can see InternalsVisibleToAttribute
is defined as below. Note the AttributeTargets
allows only for assembly
not for Types
.
[AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)]
public sealed class InternalsVisibleToAttribute : Attribute
It doesn't matter where you place this attribute, it makes all the types which are internal in assembly visible to the friend assembly.