Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 3.19 KB

keycontainer-specify-a-key-container-to-sign-an-assembly.md

File metadata and controls

65 lines (46 loc) · 3.19 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
-KEYCONTAINER (Specify a Key Container to Sign an Assembly) | Microsoft Docs
11/04/2016
cpp-tools
article
VC.Project.VCLinkerTool.KeyContainer
/keycontainer
C++
KEYCONTAINER linker option
/KEYCONTAINER linker option
-KEYCONTAINER linker option
94882d12-b77a-49c7-96d0-18a31aee001e
12
corob-msft
corob
ghogen

/KEYCONTAINER (Specify a Key Container to Sign an Assembly)

/KEYCONTAINER:name  

Remarks

where,

name
Container that contains the key. Place the string in double quotation marks (" ") if it contains a space.

Remarks

The linker creates a signed assembly by inserting a public key into the assembly manifest and signing the final assembly with the private key. To generate a key file, type sn -k filename at the command line. sn -i installs the key pair into a container.

If you compile with /LN, the name of the key file is held in the module and incorporated into the assembly that is created when you compile an assembly that includes an explicit reference to the module, via #using, or when linking with /ASSEMBLYMODULE.

You can also pass your encryption information to the compiler with /KEYFILE. Use /DELAYSIGN if you want a partially signed assembly. See Strong Name Assemblies (Assembly Signing) (C++/CLI) for more information on signing an assembly.

Other linker options that affect assembly generation are:

To set this linker option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.

  2. Click the Linker folder.

  3. Click the Command Line property page.

  4. Type the option into the Additional Options box.

To set this linker option programmatically

  • See xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A.

See Also

Setting Linker Options
Linker Options