【问题标题】:Attempt to install an assembly without a strong name尝试安装没有强名称的程序集
【发布时间】:2018-11-24 13:19:05
【问题描述】:

我在我的项目中添加了构建后命令行:

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

但我得到了错误:

The command exited with the code 1.

在输出中:

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

我该如何解决这个问题?

【问题讨论】:

  • GAC 中的程序集必须具有强名称。
  • 要么签名要么不安装在 GAC 中
  • 如何从 GAC 中删除旧程序集或对其进行签名?
  • 复制?
  • 是的,我在 GAC 中有同名的旧程序集。怎么删除?

标签: c# .net gac


【解决方案1】:

这里实际上只有两个选项,不要将程序集放入 GAC 或在将程序集放入 GAC 之前对其进行签名。


程序集需要签名才能存储在 GAC 中。

“部署在全局程序集缓存中的程序集必须具有强名称。” MSDN - Global Assembly Cache

如果您在使用强名称签署程序集时需要帮助,请遵循本文。 MSDN - How to sign an assembly


以下是一些相关链接:

Cannot install assembly to cache?

Signing assemblies - basics

C#: why sign an assembly?

How to register a non-strong-name assembly to be loaded as if it were in the GAC?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-01
    • 1970-01-01
    • 2015-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多