Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 尝试安装没有强名称的程序集_C#_.net_Gac - Fatal编程技术网

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

C# 尝试安装没有强名称的程序集,c#,.net,gac,C#,.net,Gac,我在项目中添加了生成后命令行: "%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 wi

我在项目中添加了生成后命令行:

"%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中的程序集必须具有强名称。请签名或不在GAC中安装。我可以从GAC中删除旧程序集或签名吗?重复是,我在GAC中有同名的旧程序集。如何删除它?