Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ScopeName Property

Module.ScopeName Property

Gets a string representing the name of the module.

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

public string ScopeName { get; }
/** @property */
public String get_ScopeName ()

public function get ScopeName () : String

Not applicable.

Property Value

The module name.

The ScopeName property is not used by the common language runtime, but you can use it to store any string you want in the property when you emit a module using the metadata APIs. Reflection itself does not allow you to set the ScopeName property.

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 = Assembly.GetExecutingAssembly().GetModules () [0];
        Console.WriteLine ("Module Name is "
           + mod.Name);
        Console.WriteLine ("Module FullyQualifiedName is "
           + mod.FullyQualifiedName);
        Console.WriteLine ("Module ScopeName is "
           + mod.ScopeName);
   }
}
/*
Produces this output:
Module Name is modname.exe
Module FullyQualifiedName is C:\Bin\modname.exe
Module ScopeName is modname.exe
*/

import System.Reflection.*;
import System.*;

public class Simple
{   
    public static void main(String[] args)
    {
        Module mod = Assembly.GetExecutingAssembly().GetModules()[0];
        Console.WriteLine(("Module Name is " + mod.get_Name()));
        Console.WriteLine(("Module FullyQualifiedName is " 
            + mod.get_FullyQualifiedName()));
        Console.WriteLine(("Module ScopeName is " + mod.get_ScopeName()));
    } //main
} //Simple

/*
 Produces this output:
 Module Name is modname.exe
 Module FullyQualifiedName is C:\Bin\modname.exe
 Module ScopeName is modname.exe
 */

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft