简体   繁体   English

尝试安装没有强名称的程序集

[英]Attempt to install an assembly without a strong name

I added post-build command line in my project: 我在项目中添加了构建后命令行:

"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe" /if "$(TargetFileName)"

But I got error: 但是我得到了错误:

The command exited with the code 1.

In output: 在输出中:

Failure adding assembly to the cache: Attempt to install an assembly without а strong name

How can I solve this problem? 我怎么解决这个问题?

There are really only two options here, don't place the assembly in the GAC or sign the assembly before putting it into the GAC. 此处实际上只有两种选择,不要将程序集放入GAC或在将程序集放入GAC之前对其进行签名。


The assembly needs to be signed in order to be stored in the GAC. 程序集需要签名才能存储在GAC中。

"Assemblies deployed in the Global Assembly Cache must have a strong name." “在全局程序集缓存中部署的程序集必须具有强名称。” MSDN - Global Assembly Cache MSDN-全局程序集缓存

If you need help signing an assembly with a strong name follow this article. 如果您需要帮助以强名签名程序集,请遵循本文。 MSDN - How to sign an assembly MSDN-如何签署大会


Here are some related links: 以下是一些相关链接:

Cannot install assembly to cache? 无法安装程序集以进行缓存? <-- The current post is really a duplicate of this. <-当前的帖子实际上是该帖子的副本。

Signing assemblies - basics 签名装配-基础

C#: why sign an assembly? C#:为什么要签署程序集?

How to register a non-strong-name assembly to be loaded as if it were in the GAC? 如何注册要在GAC中加载的非强名称程序集?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM