This documentation is archived and is not being maintained.

EnumBuilder.AssemblyQualifiedName Property

Returns the full path of this enum qualified by the display name of the parent assembly.

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

'Declaration
Public Overrides ReadOnly Property AssemblyQualifiedName As String

Property Value

Type: System.String
Read-only. The full path of this enum qualified by the display name of the parent assembly.

Implements

_Type.AssemblyQualifiedName

ExceptionCondition
NotSupportedException

If CreateType has not been called previously.

The format of the returned string is:

<FullTypeName>, <AssemblyDisplayName>

See AssemblyName for a description of the format of the display name of an assembly.

Version Information

In the .NET Framework version 1.1 and earlier, the return value of this property did not include the culture or public key.

The following code sample demonstrates the use of the AssemblyQualifiedName property to reference the qualified parent assembly name of the current EnumBuilder.


Imports System
Imports System.Collections
Imports System.Threading
Imports System.Reflection
Imports System.Reflection.Emit

Public Class MyEnumBuilderSample
   Private Shared myAssemblyBuilder As AssemblyBuilder
   Private Shared myModuleBuilder As ModuleBuilder
   Private Shared myEnumBuilder As EnumBuilder

   Public Shared Sub Main()
      Try
         CreateCallee(Thread.GetDomain(), AssemblyBuilderAccess.Save)
         Dim myTypeArray As Type() = myModuleBuilder.GetTypes()
         Dim myType As Type
         For Each myType In  myTypeArray
            Console.WriteLine("Enum Builder defined in the module builder is: " + myType.Name)
         Next myType

         Console.WriteLine("Properties of EnumBuilder : ")
         Console.WriteLine("Enum Assembly is :" + myEnumBuilder.Assembly.ToString())
         Console.WriteLine("Enum AssemblyQualifiedName is :" + myEnumBuilder.AssemblyQualifiedName.ToString())
         Console.WriteLine("Enum Module is :" + myEnumBuilder.Module.ToString())
         Console.WriteLine("Enum Name is :" + myEnumBuilder.Name.ToString())
         Console.WriteLine("Enum NameSpace is :" + myEnumBuilder.Namespace)
         myAssemblyBuilder.Save("EmittedAssembly.dll")
      Catch ex As NotSupportedException
         Console.WriteLine("The following is the exception is raised: " + ex.Message)
      Catch e As Exception
         Console.WriteLine("The following is the exception raised: " + e.Message)
      End Try
   End Sub 'Main

   Private Shared Sub CreateCallee(myAppDomain As AppDomain, access As AssemblyBuilderAccess)
      ' Create a name for the assembly.
      Dim myAssemblyName As New AssemblyName()
      myAssemblyName.Name = "EmittedAssembly"

      ' Create the dynamic assembly.
      myAssemblyBuilder = myAppDomain.DefineDynamicAssembly(myAssemblyName, _
                AssemblyBuilderAccess.Save)

      ' Create a dynamic module.
      myModuleBuilder = myAssemblyBuilder.DefineDynamicModule("EmittedModule", "EmittedModule.mod")

      ' Create a dynamic Enum.
      myEnumBuilder = myModuleBuilder.DefineEnum("MyNamespace.MyEnum", _
                 TypeAttributes.Public, GetType(Int32))

      Dim myFieldBuilder1 As FieldBuilder = myEnumBuilder.DefineLiteral("FieldOne", 1)
      Dim myFieldBuilder2 As FieldBuilder = myEnumBuilder.DefineLiteral("FieldTwo", 2)

      myEnumBuilder.CreateType()
   End Sub 'CreateCallee
End Class 'MyEnumBuilderSample


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.
Show: