Peristiwa
17 Mac, 9 PTG - 21 Mac, 10 PG
Sertai siri perjumpaan untuk membina penyelesaian AI berskala berdasarkan kes penggunaan dunia sebenar dengan rakan pembangun dan pakar.
Daftar sekarangPelayar ini tidak lagi disokong.
Naik taraf kepada Microsoft Edge untuk memanfaatkan ciri, kemas kini keselamatan dan sokongan teknikal yang terkini.
Specifies a file containing a key or key pair to give an assembly a strong name.
-keyfile:file
file
Required. File that contains the key. If the file name contains a space, enclose the name in quotation marks (" ").
The compiler inserts the public key into the assembly manifest and then signs the final assembly with the private key. To generate a key file, type sn -k file
at the command line. For more information, see Sn.exe (Strong Name Tool)).
If you compile with -target:module
, the name of the key file is held in the module and incorporated into the assembly that is created when you compile an assembly with -addmodule.
You can also pass your encryption information to the compiler with -keycontainer. Use -delaysign if you want a partially signed assembly.
You can also specify this option as a custom attribute (AssemblyKeyFileAttribute) in the source code for any common intermediate language module.
In case both -keyfile
and -keycontainer are specified (either by command-line option or by custom attribute) in the same compilation, the compiler first tries the key container. If that succeeds, then the assembly is signed with the information in the key container. If the compiler does not find the key container, it tries the file specified with -keyfile
. If this succeeds, the assembly is signed with the information in the key file, and the key information is installed in the key container (similar to sn -i
) so that on the next compilation, the key container will be valid.
Note that a key file might contain only the public key.
See Creating and Using Strong-Named Assemblies for more information on signing an assembly.
Nota
The -keyfile
option is not available from within the Visual Studio development environment; it is available only when compiling from the command line.
The following code compiles source file Input.vb
and specifies a key file.
vbc -keyfile:myfile.sn input.vb
.NET maklum balas
.NET ialah projek sumber terbuka. Pilih pautan untuk memberikan maklum balas:
Peristiwa
17 Mac, 9 PTG - 21 Mac, 10 PG
Sertai siri perjumpaan untuk membina penyelesaian AI berskala berdasarkan kes penggunaan dunia sebenar dengan rakan pembangun dan pakar.
Daftar sekarang