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
属性

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

sn -k TestPublicKey.snk   

例を.dllとしてコンパイルします。 コマンド ラインからコンパイルする場合は、C# または Visual Basic のオプション、または /LD Visual C++ のリンカー オプションを使用/t:libraryします。

using namespace System;
using namespace System::Reflection;

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

namespace DelaySign
{
    public ref class Test { };
}
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")]

注意事項

パスとファイル名は保持されるため、使用 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)

適用対象

こちらもご覧ください