MainModule Property

Process.MainModule Property

Gets the main module for the associated process.

[Visual Basic]
Public ReadOnly Property MainModule As ProcessModule
public ProcessModule MainModule {get;}
public: __property ProcessModule* get_MainModule();
public function get MainModule() : ProcessModule;

Property Value

The ProcessModule that was used to start the process.


Exception Type Condition
NotSupportedException You are attempting to access this property for a process on a remote computer.


A process module represents a .dll or .exe file that is loaded into a particular process. The MainModule property lets you view information about the executable used to start the process, including the module name, file name, and module memory details.

Windows 98 Platform Note:  This property is not available on this platform if you started the process with ProcessStartInfo.UseShellExecute set to true.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Process Class | Process Members | System.Diagnostics Namespace | Modules

© 2015 Microsoft