Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is [assembly: InternalsVisibleTo("MyAssembly")]? A statement, directive, ...?

Sorry about the vocabulary question but I can't find this anywhere: how do you call this below?

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("MyAssembly")]

Is it a statement, a directive, ... ? I want to indicate that you have to insert that line in order to give MyAssembly access to your assembly's internal members, but I'd like to use a more specific term than "line".

Thanks!

like image 331
Alix Avatar asked Jun 17 '10 15:06

Alix


2 Answers

It's a Global Attribute applied at the assembly level.

like image 82
Darin Dimitrov Avatar answered Nov 15 '22 12:11

Darin Dimitrov


The C# language spec refers to it as an Attribute Specification (section 17.2).

Attribute specification is the application of a previously defined attribute to a declaration. An attribute is a piece of additional declarative information that is specified for a declaration. Attributes can be specified at global scope (to specify attributes on the containing assembly or module) ...

like image 31
JaredPar Avatar answered Nov 15 '22 11:11

JaredPar