AssemblyKeyFileAttribute Class
Assembly: mscorlib (in mscorlib.dll)
'Declaration <AttributeUsageAttribute(AttributeTargets.Assembly, Inherited:=False)> _ <ComVisibleAttribute(True)> _ Public NotInheritable Class AssemblyKeyFileAttribute Inherits Attribute 'Usage Dim instance As AssemblyKeyFileAttribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false) */ /** @attribute ComVisibleAttribute(true) */ public final class AssemblyKeyFileAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false) ComVisibleAttribute(true) public final class AssemblyKeyFileAttribute extends Attribute
When building a strong-named assembly, the author must supply either this attribute or AssemblyKeyNameAttribute. If AssemblyDelaySignAttribute has also been specified, it is likely that this file will only contain the public key.
An example of the syntax is [assembly:AssemblyKeyFileAttribute("myKey.snk")].
Caution |
|---|
| Since the path and file name persist, ensure that the string you use with AssemblyKeyFileAttribute does not contain sensitive information. |
The following code example shows the use of the AssemblyDelaySignAttribute attribute with the AssemblyKeyFileAttribute. To compile this example, you must create a strong-name key file named TestPublicKey.snk using the Strong Name Tool (Sn.exe):
sn -k TestPublicKey.snk
Compile the example as a .dll. If you compile from the command line, use the /t:library option for C# or Visual Basic, or the /LD linker option for Visual C++.
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Caution