A manifest resource is simply a named item of data associated with an assembly. A manifest resource is introduced using the .mresource directive, which adds the manifest resource to the assembly manifest begun by a preceding .assembly declaration.
| Decl ::= | Clause
| .mresource
[ public
| private
] DottedName '{'
ManResDecl* '}'
| | … | §II.5.10
If the manifest resource is declared public, it is exported from the assembly. If it is declared private, it is not exported, in which case, it is only available from within the assembly. The DottedName is the name of the resource.
ManResDecl ::= | Description | Clause |
---|---|---|
.assembly extern DottedName |
Manifest resource is in external assembly with name DottedName. | §II.6.3 |
| .custom CustomDecl |
Custom attribute. | §II.21 |
| .file DottedName at Int32 |
Manifest resource is in file DottedName at byte offset Int32. |
For a resource stored in a file that is not a module (for example, an attached text file), the file shall be declared in the manifest using a separate (top-level) .file declaration (see §II.6.2.3) and the byte offset shall be zero. A resource that is defined in another assembly is referenced using .assembly extern, which requires that the assembly has been defined in a separate (top-level) .assembly extern directive (§II.6.3).