Understanding Assemblies’ Metadata

As you know, when you build an executable with Visual Basic, you build a .NET assembly. An assembly is basically a container of metadata and code. Metadata is information that the CLR uses in correctly loading and running the assembly. Figure 47.1 represents how an assembly is structured.

Figure 47.1 How an assembly is structured.

image

The Assembly Metadata, also known as assembly manifest, basically provides assembly information such as the name, version, culture, copyright information, and signature. The Type Metadata contains information on types defined within the assembly, such as class names and names of class members, including their parameters. The Code part is the actual Intermediate Language code that will be executed when the assembly is loaded. The Resources block contains all resources required by the assembly, such as images, icons, and strings. Also notice that types within an assembly can be grouped into multiple modules. A module is a container of types whereas an assembly is a container of modules. With Reflection you can inspect metadata and code from an assembly using Visual Basic code, including assembly information.

Note

When talking about assemblies, we usually refer to single file executables. Assemblies can be composed of multiple linked files; keep in mind that assembly metadata needs to reside only in the main assembly. This is a special case and cannot be accomplished with Visual Studio (you should use manually MSBuild), but it is something that it is worth mentioning.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.134.188