-delaysign-delaysign

指定程序集是完全签名的还是部分签名的。Specifies whether the assembly will be fully or partially signed.

语法Syntax

-delaysign[+ | -]

自变量Arguments

+ | -+ | -
可选。Optional. 如果需要完全签名的程序集,则使用 -delaysign-Use -delaysign- if you want a fully signed assembly. 如果希望将公钥置于程序集中,并为签名的哈希保留空间,请使用 -delaysign+Use -delaysign+ if you want to place the public key in the assembly and reserve space for the signed hash. 默认值为 -delaysign-The default is -delaysign-.

备注Remarks

除非与 -keyfile-keycontainer 一同使用,否则 -delaysign 选项将不起作用。The -delaysign option has no effect unless used with -keyfile or -keycontainer.

在请求完全签名的程序集时,编译器会对包含清单(程序集元数据)的文件进行哈希处理,并使用私钥对哈希进行签名。When you request a fully signed assembly, the compiler hashes the file that contains the manifest (assembly metadata) and signs that hash with the private key. 产生的数字签名存储在包含清单的文件中。The resulting digital signature is stored in the file that contains the manifest. 在对程序集延迟签名时,编译器不会计算和存储签名,而是在文件中保留空间,以便稍后可添加签名。When an assembly is delay signed, the compiler does not compute and store the signature but reserves space in the file so the signature can be added later.

例如,通过使用 -delaysign+,组织中的开发人员可以分发程序集的未签名测试版本,测试人员可以将该版本注册到全局程序集缓存并使用。For example, by using -delaysign+, a developer in an organization can distribute unsigned test versions of an assembly that testers can register with the global assembly cache and use. 在程序集上完成工作后,负责组织私钥的人员可以对程序集进行完全签名。When work on the assembly is completed, the person responsible for the organization's private key can fully sign the assembly. 此区室化可防止组织私钥泄露,同时允许所有开发人员处理程序集。This compartmentalization protects the organization's private key from disclosure, while allowing all developers to work on the assemblies.

有关对程序集签名的详细信息,请参阅创建和使用具有强名称的程序集See Creating and Using Strong-Named Assemblies for more information on signing an assembly.

在 Visual Studio 集成开发环境中设置 -delaysignTo set -delaysign in the Visual Studio integrated development environment

  1. “解决方案资源管理器” 中选择一个项目。Have a project selected in Solution Explorer. 在“项目”菜单上,单击“属性” 。On the Project menu, click Properties.

  2. 单击“签名”选项卡。 Click the Signing tab.

  3. 设置“仅延迟签名” 框中的值。Set the value in the Delay sign only box.

请参阅See also