Gets the module in which the type that declares the member represented by the current MemberInfo is defined.
Assembly: mscorlib (in mscorlib.dll)
The following code example declares a class that inherits Object and overrides Object.ToString. The example obtains MethodInfo objects for the class's ToString method and for the inherited GetHashCode method, and displays the names of the modules in which the two methods are declared.
Imports System Imports System.Reflection Public Class Test Public Overrides Function ToString() As String Return "An instance of class Test!" End Function End Class Public Class Example Public Shared Sub Main() Dim t As New Test() Dim mi As MethodInfo = t.GetType().GetMethod("ToString") Console.WriteLine(mi.Name & " is defined in " & mi.Module.Name) mi = t.GetType().GetMethod("GetHashCode") Console.WriteLine(mi.Name & " is defined in " & mi.Module.Name) End Sub End Class ' This example produces code similar to the following: ' 'ToString is defined in source.exe 'GetHashCode is defined in mscorlib.dll
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.