AssemblyKeyFileAttribute Class
Specifies the name of a file containing the key pair used to generate a strong name.
Assembly: mscorlib (in mscorlib.dll)
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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Caution: