Getting Assembly Information

You get assembly metadata information by creating an instance of the System.Reflection.Assembly class. This class provides both static and instance members for accessing assembly information. Typically, you use one of the methods summarized in Table 44.1 to load an assembly for getting information.

Image

TABLE 44.1 Methods for Loading an Assembly

When you get the instance of the assembly you want to inspect, you can access information via some useful properties. The code in Listing 44.2 shows how to accomplish this. (See comments for explanations.)

LISTING 44.2 Inspecting Assembly Information

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.