AssemblyKeyFileAttribute クラス

定義

厳密な名前の生成に使用されるキー ペアを含むファイルの名前を指定します。

public ref class AssemblyKeyFileAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, Inherited=false)]
public sealed class AssemblyKeyFileAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false)]
public sealed class AssemblyKeyFileAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class AssemblyKeyFileAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, Inherited=false)>]
type AssemblyKeyFileAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false)>]
type AssemblyKeyFileAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, Inherited=false)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type AssemblyKeyFileAttribute = class
    inherit Attribute
Public NotInheritable Class AssemblyKeyFileAttribute
Inherits Attribute
継承
AssemblyKeyFileAttribute
属性

次のコード例は、AssemblyKeyFileAttributeAssemblyDelaySignAttribute属性を使用する方法を示しています。 この例をコンパイルするには、Sn.exe (厳密な名前ツール) を使用して TestPublicKey.snk という名前の 厳密な名前のキー ファイルを作成する必要があります。

sn -k TestPublicKey.snk

例を .dllとしてコンパイルします。 コマンド ラインからコンパイルする場合は、 /t:library オプションを使用します。

using System;
using System.Reflection;

[assembly:AssemblyKeyFileAttribute("TestPublicKey.snk")]
[assembly:AssemblyDelaySignAttribute(true)]

namespace DelaySign
{
    public class Test { }
}
Imports System.Reflection

<assembly:AssemblyDelaySignAttribute(true)>
<assembly:AssemblyKeyFileAttribute("TestPublicKey.snk")>

Namespace DelaySign

    Public class Test
    End Class

End Namespace

注釈

厳密な名前のアセンブリをビルドする場合、作成者はこの属性または AssemblyKeyNameAttributeを指定する必要があります。 AssemblyDelaySignAttributeも指定されている場合、このファイルには公開キーのみが含まれる可能性があります。

構文の例として、 [assembly:AssemblyKeyFileAttribute("myKey.snk")]があります。

Caution

パスとファイル名は保持されるため、 AssemblyKeyFileAttribute で使用する文字列に機密情報が含まれていないことを確認します。

コンストラクター

名前 説明
AssemblyKeyFileAttribute(String)

属性付きアセンブリの厳密な名前を生成するために、キー ペアを含むファイルの名前を使用して、 AssemblyKeyFileAttribute クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
KeyFile

属性付きアセンブリの厳密な名前を生成するために使用されるキー ペアを含むファイルの名前を取得します。

TypeId

派生クラスで実装されている場合は、この Attributeの一意の識別子を取得します。

(継承元 Attribute)

メソッド

名前 説明
Equals(Object)

このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされた場合、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラスでオーバーライドされた場合、このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

名前 説明
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

インターフェイスの型情報を取得するために使用できるオブジェクトの型情報を取得します。

(継承元 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されるプロパティとメソッドへのアクセスを提供します。

(継承元 Attribute)

適用対象

こちらもご覧ください