Module.Name Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets a String representing the name of the module with the path removed.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

public virtual string Name { get; }

Property Value

Type: System.String

The module name with no path.

Name is a platform-dependent string.

If the assembly for this module was loaded from a byte array then the FullyQualifiedName for the module will be: <Unknown>.

To get the name and the path, use FullyQualifiedName.

This example shows the effect of the ScopeName, FullyQualifiedName, and Name properties.

using System.Reflection;
using System;

 public class Simple
    public static void Main ()
         Module mod = typeof(Simple).Assembly.GetModules () [0];
         Console.WriteLine ("Module Name is " + mod.Name);
         Console.WriteLine ("Module FullyQualifiedName is " + mod.FullyQualifiedName);
         Console.WriteLine ("Module ScopeName is " + mod.ScopeName);
 This code produces output like the following:

 Module Name is modname.exe
 Module FullyQualifiedName is C:\Bin\modname.exe
 Module ScopeName is modname.exe

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top