Visual Basic Compiler Options  

/keycontainer

Specifies a key container name for a key pair to give an assembly a strong name.

/keycontainer:container

-or-

/keycontainer:"container"

Arguments

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

Remarks

The compiler creates the sharable component 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 file at the command line.

You can also pass your encryption information to the compiler with /keyfile. Use /delaysign if you want a partially signed assembly.

See Creating and Using Strong-Named Assemblies for more information on signing an assembly.

This option is not available within the development environment.

To set /keycontainer programmatically

Example

The following code compiles source file input.vb and specifies a key container:

vbc /keycontainer:key1 input.vb

See Also

Assemblies | Visual Basic Compiler Options | /keyfile | Sample Compilation Command Lines