AssemblyFlagsAttributeとは? わかりやすく解説

AssemblyFlagsAttribute クラス

Just-In-Time (JIT) コンパイラオプション、そのアセンブリが再ターゲット可能かどうか、およびそのアセンブリが完全な公開キートークン化され公開キーのどちらを保有しているのかなどを示す、アセンブリの AssemblyNameFlags フラグの、ビットごとの組み合わせ指定します。このクラス継承できません。

名前空間: System.Reflection
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
<AttributeUsageAttribute(AttributeTargets.Assembly, Inherited:=False)> _
Public NotInheritable Class
 AssemblyFlagsAttribute
    Inherits Attribute
Dim instance As AssemblyFlagsAttribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false)]
 
public sealed class AssemblyFlagsAttribute
 : Attribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets::Assembly, Inherited=false)]
 
public ref class AssemblyFlagsAttribute sealed
 : public Attribute
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false)
 */ 
public final class AssemblyFlagsAttribute extends
 Attribute
ComVisibleAttribute(true) 
AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false)
 
public final class AssemblyFlagsAttribute extends
 Attribute
解説解説

AssemblyNameFlags 列挙体は、アセンブリ特性示し、この属性使用して設定できます

アセンブリに対して指定されフラグ調べるには、System.Reflection.Assembly.GetName プロパティ使用して AssemblyName オブジェクト取得したうえで、AssemblyName.Flags プロパティ使用して AssemblyNameFlags 値を取得します

動的アセンブリに対して AssemblyNameFlags フラグ指定するには、System.AppDomain.DefineDynamicAssembly メソッドに渡す AssemblyName オブジェクトAssemblyName.Flags プロパティ設定します

使用例使用例

次のコード例は、アセンブリAssemblyFlagsAttribute適用する方法、およびフラグ実行時読み込む方法示してます。またこの例では、属性インスタンス作成し、AssemblyFlags プロパティ使用してフラグ表示してます。動的アセンブリAssemblyFlagsAttribute適用する方法例については、AssemblyName.Flags プロパティ参照してください

Imports System
Imports System.Reflection

' Specify a combination of AssemblyNameFlags for this 
' assembly.
<Assembly:AssemblyFlagsAttribute( _
       AssemblyNameFlags.EnableJITcompileOptimizer _
    Or AssemblyNameFlags.Retargetable)>

Public Class Example
    Public Shared Sub Main()
        ' Get the currently executing assembly, which is this
        ' assembly.
        Dim thisAsm As Assembly
 = _
             Assembly.GetExecutingAssembly()

        ' Get the AssemblyName for the currently executing
        ' assembly.
        Dim thisAsmName As AssemblyName = thisAsm.GetName(False)

        ' Display the flags that were set for this assembly.
        ListFlags(thisAsmName.Flags)

        ' Create an instance of AssemblyFlagsAttribute with the
        ' same combination of flags that was specified for this
        ' assembly. Note that PublicKey is included automatically
        ' for the assembly, but not for this instance of
        ' AssemblyFlagsAttribute.
        Dim afa As New AssemblyFlagsAttribute(
 _
               AssemblyNameFlags.EnableJITcompileOptimizer _
            Or AssemblyNameFlags.Retargetable)

        ' Get the flags. The property returns an integer, so
        ' the return value must be cast to AssemblyNameFlags.
        Dim anf As AssemblyNameFlags = _
            CType(afa.AssemblyFlags, AssemblyNameFlags)

        ' Display the flags.
        Console.WriteLine()
        ListFlags(anf)
    End Sub

    Private Shared Sub ListFlags(ByVal
 anf As AssemblyNameFlags)

        If anf = AssemblyNameFlags.None Then
            Console.WriteLine("AssemblyNameFlags.None")
        Else
            If 0 <> (anf And AssemblyNameFlags.Retargetable)
 Then _
                Console.WriteLine("AssemblyNameFlags.Retargetable")
            If 0 <> (anf And AssemblyNameFlags.PublicKey)
 Then _
                Console.WriteLine("AssemblyNameFlags.PublicKey")
            If 0 <> (anf And AssemblyNameFlags.EnableJITcompileOptimizer)
 Then _
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileOptimizer")
            If 0 <> (anf And AssemblyNameFlags.EnableJITcompileTracking)
 Then _
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileTracking")
        End If

    End SUb
End Class

' This code example produces the following output:
'
'AssemblyNameFlags.Retargetable
'AssemblyNameFlags.PublicKey
'AssemblyNameFlags.EnableJITcompileOptimizer
'
'AssemblyNameFlags.Retargetable
'AssemblyNameFlags.EnableJITcompileOptimizer
using System;
using System.Reflection;

// Specify a combination of AssemblyNameFlags for this 
// assembly.
[assembly:AssemblyFlagsAttribute(
    AssemblyNameFlags.EnableJITcompileOptimizer |
    AssemblyNameFlags.Retargetable)]

public class Example
{
    public static void Main()
    {
        // Get the currently executing assembly, which is this
        // assembly.
        Assembly thisAsm = Assembly.GetExecutingAssembly();

        // Get the AssemblyName for the currently executing
        // assembly.
        AssemblyName thisAsmName = thisAsm.GetName(false);

        // Display the flags that were set for this assembly.
        ListFlags(thisAsmName.Flags);

        // Create an instance of AssemblyFlagsAttribute with the
        // same combination of flags that was specified for this
        // assembly. Note that PublicKey is included automatically
        // for the assembly, but not for this instance of
        // AssemblyFlagsAttribute.
        AssemblyFlagsAttribute afa = new AssemblyFlagsAttribute(
            AssemblyNameFlags.EnableJITcompileOptimizer |
            AssemblyNameFlags.Retargetable);

        // Get the flags. The property returns an integer, so
        // the return value must be cast to AssemblyNameFlags.
        AssemblyNameFlags anf = (AssemblyNameFlags) afa.AssemblyFlags;

        // Display the flags.
        Console.WriteLine();
        ListFlags(anf);
    }

    private static void
 ListFlags(AssemblyNameFlags anf)
    {
        if (anf == AssemblyNameFlags.None)
        {
            Console.WriteLine("AssemblyNameFlags.None");
        }
        else
        {
            if (0!=(anf & AssemblyNameFlags.Retargetable))
 
                Console.WriteLine("AssemblyNameFlags.Retargetable");
            if (0!=(anf & AssemblyNameFlags.PublicKey)) 
                Console.WriteLine("AssemblyNameFlags.PublicKey");
            if (0!=(anf & AssemblyNameFlags.EnableJITcompileOptimizer))
 
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileOptimizer");
            if (0!=(anf & AssemblyNameFlags.EnableJITcompileTracking))
 
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileTracking");
        }
    }
}

/* This code example produces the following output:

AssemblyNameFlags.Retargetable
AssemblyNameFlags.PublicKey
AssemblyNameFlags.EnableJITcompileOptimizer

AssemblyNameFlags.Retargetable
AssemblyNameFlags.EnableJITcompileOptimizer
*/
using namespace System;
using namespace System::Reflection;

// Specify a combination of AssemblyNameFlags for this
// assembly.
[assembly:AssemblyFlagsAttribute(
     AssemblyNameFlags::EnableJITcompileOptimizer
   | AssemblyNameFlags::Retargetable)];

public ref class Example
{
public:
   static void Main()
   {
      // Get the currently executing assembly, which is this
      // assembly.
      Assembly^ thisAsm = Assembly::GetExecutingAssembly();
      
      // Get the AssemblyName for the currently executing
      // assembly.
      AssemblyName^ thisAsmName = thisAsm->GetName( false );
      
      // Display the flags that were set for this assembly.
      ListFlags( thisAsmName->Flags );
      
      // Create an instance of AssemblyFlagsAttribute with the
      // same combination of flags that was specified for this
      // assembly. Note that PublicKey is included automatically
      // for the assembly, but not for this instance of
      // AssemblyFlagsAttribute.
      AssemblyFlagsAttribute^ afa = gcnew AssemblyFlagsAttribute( 
         static_cast<AssemblyNameFlags> (AssemblyNameFlags::EnableJITcompileOptimizer
                                       | AssemblyNameFlags::Retargetable) );
      
      // Get the flags. The property returns an integer, so
      // the return value must be cast to AssemblyNameFlags.
      AssemblyNameFlags anf = static_cast<AssemblyNameFlags>(afa->AssemblyFlags);
      
      // Display the flags.
      Console::WriteLine();
      ListFlags( anf );
   }

private:
   static void ListFlags( AssemblyNameFlags
 anf )
   {
      if ( anf == AssemblyNameFlags::None )
      {
         Console::WriteLine( L"AssemblyNameFlags.None" );
      }
      else
      {
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::Retargetable)
 )
                  Console::WriteLine( L"AssemblyNameFlags.Retargetable"
 );
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::PublicKey)
 )
                  Console::WriteLine( L"AssemblyNameFlags.PublicKey" );
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::EnableJITcompileOptimizer)
 )
                  Console::WriteLine( L"AssemblyNameFlags.EnableJITcompileOptimizer"
 );
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::EnableJITcompileTracking)
 )
                  Console::WriteLine( L"AssemblyNameFlags.EnableJITcompileTracking"
 );
      }
   }

};

int main()
{
   Example::Main();
}

/* This code example produces the following output:

AssemblyNameFlags.Retargetable
AssemblyNameFlags.PublicKey
AssemblyNameFlags.EnableJITcompileOptimizer

AssemblyNameFlags.Retargetable
AssemblyNameFlags.EnableJITcompileOptimizer
*/
継承階層継承階層
System.Object
   System.Attribute
    System.Reflection.AssemblyFlagsAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
AssemblyFlagsAttribute メンバ
System.Reflection 名前空間
AssemblyNameFlags
System.Reflection.Assembly.GetName
AssemblyName.Flags

AssemblyFlagsAttribute コンストラクタ (Int32)

メモ : このコンストラクタは、互換性のために残されています。 旧式でない代替必要な場合は、AssemblyFlagsAttribute(AssemblyNameFlags) を使用してください

整数値としてキャストされている AssemblyNameFlags フラグ組み合わせ指定して、AssemblyFlagsAttribute クラス新しインスタンス初期化します。

名前空間: System.Reflection
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ObsoleteAttribute("This constructor has been deprecated. Please
 use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")>
 _
Public Sub New ( _
    assemblyFlags As Integer _
)
Dim assemblyFlags As Integer

Dim instance As New AssemblyFlagsAttribute(assemblyFlags)
[ObsoleteAttribute("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags)
 instead. http://go.microsoft.com/fwlink/?linkid=14202")] 
public AssemblyFlagsAttribute (
    int assemblyFlags
)
[ObsoleteAttribute(L"This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags)
 instead. http://go.microsoft.com/fwlink/?linkid=14202")] 
public:
AssemblyFlagsAttribute (
    int assemblyFlags
)
/** @attribute ObsoleteAttribute("This constructor has been deprecated. Please
 use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")
 */ 
public AssemblyFlagsAttribute (
    int assemblyFlags
)
ObsoleteAttribute("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags)
 instead. http://go.microsoft.com/fwlink/?linkid=14202") 
public function AssemblyFlagsAttribute (
    assemblyFlags : int
)

パラメータ

assemblyFlags

Just-In-Time (JIT) コンパイラオプション有効期限、そのアセンブリが再ターゲット可能かどうか、およびそのアセンブリが完全な公開キートークン化され公開キーのどちらを保有しているのかを示す、整数値としてキャストされた AssemblyNameFlags フラグビットごとの組み合わせ

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
AssemblyFlagsAttribute クラス
AssemblyFlagsAttribute メンバ
System.Reflection 名前空間

AssemblyFlagsAttribute コンストラクタ (UInt32)

メモ : このコンストラクタは、互換性のために残されています。 旧式でない代替必要な場合は、AssemblyFlagsAttribute(AssemblyNameFlags)使用してください

符号なし整数値としてキャストされている AssemblyNameFlags フラグ組み合わせ指定して、AssemblyFlagsAttribute クラス新しインスタンス初期化します。

このコンストラクタは、CLS準拠していません。  CLS準拠する代替必要な場合は、AssemblyFlagsAttribute(AssemblyNameFlags) を使用してください

名前空間: System.Reflection
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ObsoleteAttribute("This constructor has been deprecated. Please
 use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")>
 _
<CLSCompliantAttribute(False)> _
Public Sub New ( _
    flags As UInteger _
)
Dim flags As UInteger

Dim instance As New AssemblyFlagsAttribute(flags)
[ObsoleteAttribute("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags)
 instead. http://go.microsoft.com/fwlink/?linkid=14202")] 
[CLSCompliantAttribute(false)] 
public AssemblyFlagsAttribute (
    uint flags
)
[ObsoleteAttribute(L"This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags)
 instead. http://go.microsoft.com/fwlink/?linkid=14202")] 
[CLSCompliantAttribute(false)] 
public:
AssemblyFlagsAttribute (
    unsigned int flags
)
/** @attribute ObsoleteAttribute("This constructor has been deprecated. Please
 use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")
 */ 
/** @attribute CLSCompliantAttribute(false) */ 
public AssemblyFlagsAttribute (
    UInt32 flags
)
ObsoleteAttribute("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags)
 instead. http://go.microsoft.com/fwlink/?linkid=14202") 
CLSCompliantAttribute(false) 
public function AssemblyFlagsAttribute (
    flags : uint
)

パラメータ

flags

Just-In-Time (JIT) コンパイラオプション有効期限、そのアセンブリが再ターゲット可能かどうか、およびそのアセンブリが完全な公開キートークン化され公開キーのどちらを保有しているのかを示す、符号なし整数値としてキャストされた AssemblyNameFlags フラグビットごとの組み合わせ

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
AssemblyFlagsAttribute クラス
AssemblyFlagsAttribute メンバ
System.Reflection 名前空間

AssemblyFlagsAttribute コンストラクタ

AssemblyFlagsAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
AssemblyFlagsAttribute (AssemblyNameFlags) AssemblyNameFlags フラグ組み合わせ指定して AssemblyFlagsAttribute クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

AssemblyFlagsAttribute (Int32) 整数値としてキャストされている AssemblyNameFlags フラグ組み合わせ指定してAssemblyFlagsAttribute クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

AssemblyFlagsAttribute (UInt32) 符号なし整数値としてキャストされている AssemblyNameFlags フラグ組み合わせ指定してAssemblyFlagsAttribute クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

参照参照

関連項目

AssemblyFlagsAttribute クラス
AssemblyFlagsAttribute メンバ
System.Reflection 名前空間
AssemblyNameFlags

AssemblyFlagsAttribute コンストラクタ (AssemblyNameFlags)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

AssemblyNameFlags フラグ組み合わせ指定して AssemblyFlagsAttribute クラス新しインスタンス初期化します。

名前空間: System.Reflection
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    assemblyFlags As AssemblyNameFlags _
)
Dim assemblyFlags As AssemblyNameFlags

Dim instance As New AssemblyFlagsAttribute(assemblyFlags)
public AssemblyFlagsAttribute (
    AssemblyNameFlags assemblyFlags
)
public:
AssemblyFlagsAttribute (
    AssemblyNameFlags assemblyFlags
)
public AssemblyFlagsAttribute (
    AssemblyNameFlags assemblyFlags
)
public function AssemblyFlagsAttribute (
    assemblyFlags : AssemblyNameFlags
)

パラメータ

assemblyFlags

Just-In-Time (JIT) コンパイラオプション有効期限、そのアセンブリが再ターゲット可能かどうか、およびそのアセンブリが完全な公開キートークン化され公開キーのどちらを保有しているのかを示す AssemblyNameFlags フラグの、ビットごとの組み合わせ

使用例使用例

次のコード例は、アセンブリAssemblyFlagsAttribute適用する方法、およびフラグ実行時読み込む方法示してます。またこの例では、属性インスタンス作成し、AssemblyFlags プロパティ使用してフラグ表示してます。動的アセンブリAssemblyFlagsAttribute適用する方法例については、AssemblyName.Flags プロパティ参照してください

Imports System
Imports System.Reflection

' Specify a combination of AssemblyNameFlags for this 
' assembly.
<Assembly:AssemblyFlagsAttribute( _
       AssemblyNameFlags.EnableJITcompileOptimizer _
    Or AssemblyNameFlags.Retargetable)>

Public Class Example
    Public Shared Sub Main()
        ' Get the currently executing assembly, which is this
        ' assembly.
        Dim thisAsm As Assembly
 = _
             Assembly.GetExecutingAssembly()

        ' Get the AssemblyName for the currently executing
        ' assembly.
        Dim thisAsmName As AssemblyName = thisAsm.GetName(False)

        ' Display the flags that were set for this assembly.
        ListFlags(thisAsmName.Flags)

        ' Create an instance of AssemblyFlagsAttribute with the
        ' same combination of flags that was specified for this
        ' assembly. Note that PublicKey is included automatically
        ' for the assembly, but not for this instance of
        ' AssemblyFlagsAttribute.
        Dim afa As New AssemblyFlagsAttribute(
 _
               AssemblyNameFlags.EnableJITcompileOptimizer _
            Or AssemblyNameFlags.Retargetable)

        ' Get the flags. The property returns an integer, so
        ' the return value must be cast to AssemblyNameFlags.
        Dim anf As AssemblyNameFlags = _
            CType(afa.AssemblyFlags, AssemblyNameFlags)

        ' Display the flags.
        Console.WriteLine()
        ListFlags(anf)
    End Sub

    Private Shared Sub ListFlags(ByVal
 anf As AssemblyNameFlags)

        If anf = AssemblyNameFlags.None Then
            Console.WriteLine("AssemblyNameFlags.None")
        Else
            If 0 <> (anf And AssemblyNameFlags.Retargetable)
 Then _
                Console.WriteLine("AssemblyNameFlags.Retargetable")
            If 0 <> (anf And AssemblyNameFlags.PublicKey)
 Then _
                Console.WriteLine("AssemblyNameFlags.PublicKey")
            If 0 <> (anf And AssemblyNameFlags.EnableJITcompileOptimizer)
 Then _
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileOptimizer")
            If 0 <> (anf And AssemblyNameFlags.EnableJITcompileTracking)
 Then _
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileTracking")
        End If

    End SUb
End Class

' This code example produces the following output:
'
'AssemblyNameFlags.Retargetable
'AssemblyNameFlags.PublicKey
'AssemblyNameFlags.EnableJITcompileOptimizer
'
'AssemblyNameFlags.Retargetable
'AssemblyNameFlags.EnableJITcompileOptimizer
using System;
using System.Reflection;

// Specify a combination of AssemblyNameFlags for this 
// assembly.
[assembly:AssemblyFlagsAttribute(
    AssemblyNameFlags.EnableJITcompileOptimizer |
    AssemblyNameFlags.Retargetable)]

public class Example
{
    public static void Main()
    {
        // Get the currently executing assembly, which is this
        // assembly.
        Assembly thisAsm = Assembly.GetExecutingAssembly();

        // Get the AssemblyName for the currently executing
        // assembly.
        AssemblyName thisAsmName = thisAsm.GetName(false);

        // Display the flags that were set for this assembly.
        ListFlags(thisAsmName.Flags);

        // Create an instance of AssemblyFlagsAttribute with the
        // same combination of flags that was specified for this
        // assembly. Note that PublicKey is included automatically
        // for the assembly, but not for this instance of
        // AssemblyFlagsAttribute.
        AssemblyFlagsAttribute afa = new AssemblyFlagsAttribute(
            AssemblyNameFlags.EnableJITcompileOptimizer |
            AssemblyNameFlags.Retargetable);

        // Get the flags. The property returns an integer, so
        // the return value must be cast to AssemblyNameFlags.
        AssemblyNameFlags anf = (AssemblyNameFlags) afa.AssemblyFlags;

        // Display the flags.
        Console.WriteLine();
        ListFlags(anf);
    }

    private static void
 ListFlags(AssemblyNameFlags anf)
    {
        if (anf == AssemblyNameFlags.None)
        {
            Console.WriteLine("AssemblyNameFlags.None");
        }
        else
        {
            if (0!=(anf & AssemblyNameFlags.Retargetable))
 
                Console.WriteLine("AssemblyNameFlags.Retargetable");
            if (0!=(anf & AssemblyNameFlags.PublicKey)) 
                Console.WriteLine("AssemblyNameFlags.PublicKey");
            if (0!=(anf & AssemblyNameFlags.EnableJITcompileOptimizer))
 
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileOptimizer");
            if (0!=(anf & AssemblyNameFlags.EnableJITcompileTracking))
 
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileTracking");
        }
    }
}

/* This code example produces the following output:

AssemblyNameFlags.Retargetable
AssemblyNameFlags.PublicKey
AssemblyNameFlags.EnableJITcompileOptimizer

AssemblyNameFlags.Retargetable
AssemblyNameFlags.EnableJITcompileOptimizer
*/
using namespace System;
using namespace System::Reflection;

// Specify a combination of AssemblyNameFlags for this
// assembly.
[assembly:AssemblyFlagsAttribute(
     AssemblyNameFlags::EnableJITcompileOptimizer
   | AssemblyNameFlags::Retargetable)];

public ref class Example
{
public:
   static void Main()
   {
      // Get the currently executing assembly, which is this
      // assembly.
      Assembly^ thisAsm = Assembly::GetExecutingAssembly();
      
      // Get the AssemblyName for the currently executing
      // assembly.
      AssemblyName^ thisAsmName = thisAsm->GetName( false );
      
      // Display the flags that were set for this assembly.
      ListFlags( thisAsmName->Flags );
      
      // Create an instance of AssemblyFlagsAttribute with the
      // same combination of flags that was specified for this
      // assembly. Note that PublicKey is included automatically
      // for the assembly, but not for this instance of
      // AssemblyFlagsAttribute.
      AssemblyFlagsAttribute^ afa = gcnew AssemblyFlagsAttribute( 
         static_cast<AssemblyNameFlags> (AssemblyNameFlags::EnableJITcompileOptimizer
                                       | AssemblyNameFlags::Retargetable) );
      
      // Get the flags. The property returns an integer, so
      // the return value must be cast to AssemblyNameFlags.
      AssemblyNameFlags anf = static_cast<AssemblyNameFlags>(afa->AssemblyFlags);
      
      // Display the flags.
      Console::WriteLine();
      ListFlags( anf );
   }

private:
   static void ListFlags( AssemblyNameFlags
 anf )
   {
      if ( anf == AssemblyNameFlags::None )
      {
         Console::WriteLine( L"AssemblyNameFlags.None" );
      }
      else
      {
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::Retargetable)
 )
                  Console::WriteLine( L"AssemblyNameFlags.Retargetable"
 );
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::PublicKey)
 )
                  Console::WriteLine( L"AssemblyNameFlags.PublicKey" );
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::EnableJITcompileOptimizer)
 )
                  Console::WriteLine( L"AssemblyNameFlags.EnableJITcompileOptimizer"
 );
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::EnableJITcompileTracking)
 )
                  Console::WriteLine( L"AssemblyNameFlags.EnableJITcompileTracking"
 );
      }
   }

};

int main()
{
   Example::Main();
}

/* This code example produces the following output:

AssemblyNameFlags.Retargetable
AssemblyNameFlags.PublicKey
AssemblyNameFlags.EnableJITcompileOptimizer

AssemblyNameFlags.Retargetable
AssemblyNameFlags.EnableJITcompileOptimizer
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
AssemblyFlagsAttribute クラス
AssemblyFlagsAttribute メンバ
System.Reflection 名前空間
AssemblyNameFlags

AssemblyFlagsAttribute プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ .NET Compact Framework によるサポート .NET Compact Framework によるサポート TypeId  派生クラス実装されている場合は、この Attribute一意識別子取得します。 ( Attribute から継承されます。)
参照参照

関連項目

AssemblyFlagsAttribute クラス
System.Reflection 名前空間
AssemblyNameFlags
System.Reflection.Assembly.GetName
AssemblyName.Flags

AssemblyFlagsAttribute メソッド


パブリック メソッドパブリック メソッド

  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 ( Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
参照参照

関連項目

AssemblyFlagsAttribute クラス
System.Reflection 名前空間
AssemblyNameFlags
System.Reflection.Assembly.GetName
AssemblyName.Flags

AssemblyFlagsAttribute メンバ

Just-In-Time (JIT) コンパイラオプション、そのアセンブリが再ターゲット可能かどうか、およびそのアセンブリが完全な公開キートークン化され公開キーのどちらを保有しているのかなどを示す、アセンブリの AssemblyNameFlags フラグの、ビットごとの組み合わせ指定します。このクラス継承できません。

AssemblyFlagsAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド AssemblyFlagsAttribute オーバーロードされます。 AssemblyFlagsAttribute クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ .NET Compact Framework によるサポート .NET Compact Framework によるサポート TypeId  派生クラス実装されている場合は、この Attribute一意識別子取得します。(Attribute から継承されます。)
パブリック メソッドパブリック メソッド
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 (Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
参照参照

関連項目

AssemblyFlagsAttribute クラス
System.Reflection 名前空間
AssemblyNameFlags
System.Reflection.Assembly.GetName
AssemblyName.Flags



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「AssemblyFlagsAttribute」の関連用語

AssemblyFlagsAttributeのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



AssemblyFlagsAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS