Assembly.GetModules Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets all the modules that are part of this assembly.
Assembly: mscorlib (in mscorlib.dll)
| Exception | Condition |
|---|---|
| FileNotFoundException | The module to be loaded does not specify a file name extension. |
The following example displays the name of the module in the returned array that contains the assembly manifest.
Imports System.Reflection Public Class Example Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock) Dim mainAssembly As [Assembly] = [Assembly].GetExecutingAssembly() outputBlock.Text += String.Format("The executing assembly is {0}.", mainAssembly) & vbCrLf Dim mods() As [Module] = mainAssembly.GetModules() outputBlock.Text &= vbTab & "Modules in the assembly:" & vbCrLf For Each m As [Module] In mods outputBlock.Text &= vbTab & m.ToString() & vbCrLf Next End Sub 'Main End Class 'Form1
Show:
Note: