Gets the module (the DLL) in which the current Type is defined.
Assembly: mscorlib (in mscorlib.dll)
Public MustOverride ReadOnly Property Module As Modulepublic abstract Module Module { get; }public:
virtual property Module^ Module {
Module^ get () abstract;
}abstract Module : Module
Implements
_TypeIf the current Type represents a constructed generic type, this property returns the module in which the generic type definition was defined. For example, if you create an instance of MyGenericStack<int>, the Module property for the constructed type returns the module in which MyGenericStack<T> is defined.
Similarly, if the current Type represents a generic parameter T, this property returns the assembly that contains the generic type that defines T.
This following example demonstrates a use of the Namespace and Module properties and the ToString method of Type.
Imports System
Imports Microsoft.VisualBasic
Namespace MyNamespace
Class [MyClass]
End Class '[MyClass]
End Namespace 'MyNamespace
Public Class Type_ToString_3
Public Shared Sub Main()
Try
Dim myType As Type = GetType(MyNamespace.MyClass)
Console.WriteLine(ControlChars.NewLine + "Printing the details of {0}." + ControlChars.NewLine, myType)
' Get the namespace of the class Type_ToString_3.
Console.WriteLine("Namespace: {0}.", myType.Namespace)
' Get the name of the module.
Console.WriteLine("Module: {0}.", myType.Module)
' Get the fully qualified common language runtime namespace.
Console.WriteLine("Fully qualified type: {0}.", myType.ToString())
Catch e As Exception
Console.WriteLine("Exception: " + e.Message.ToString())
End Try
End Sub 'Main
End Class 'Type_ToString_3
using System;
namespace MyNamespace
{
class MyClass
{
}
}
public class Type_ToString_3
{
public static void Main()
{
try
{
Type myType = typeof(MyNamespace.MyClass);
Console.WriteLine("\nPrinting the details of {0}.\n", myType);
// Get the namespace of the class Type_ToString_3.
Console.WriteLine("Namespace: {0}.", myType.Namespace);
// Get the name of the module.
Console.WriteLine("Module: {0}.", myType.Module);
// Get the fully qualified common language runtime namespace.
Console.WriteLine("Fully qualified type: {0}.", myType.ToString());
}
catch(Exception e)
{
Console.WriteLine("Exception: " + e.Message );
}
}
}
using namespace System;
namespace MyNamespace
{
ref class MyClass{};
}
int main()
{
try
{
Type^ myType = MyNamespace::MyClass::typeid;
Console::WriteLine( "\nPrinting the details of {0}.\n", myType );
// Get the namespace of the class MyClass.
Console::WriteLine( "Namespace: {0}.", myType->Namespace );
// Get the name of the module.
Console::WriteLine( "Module: {0}.", myType->Module );
// Get the fully qualified common language runtime namespace.
Console::WriteLine( "Fully qualified type: {0}.", myType );
}
catch ( Exception^ e )
{
Console::WriteLine( "Exception: {0}", e->Message );
}
}
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.