无法安装程序集以进行缓存?

问题描述:

我试图将程序集添加到Visual Studio 2010命令提示符下的缓存中。我收到此错误无法将程序集添加到缓存:尝试安装没有强名的程序集。我正在从名为ListTasks2的WCF服务应用程序中添加ListTasks2.dll程序集。我从未在同名项目中遇到此问题,所以为什么现在引发问题?

I am trying to add an assembly to the cache on Visual Studio 2010 Command Prompt. I get this error "Failure adding assembly to the cache: Attempt to install an assembly without a strong name". I am adding a ListTasks2.dll assembly from a WCF Service App called ListTasks2. I never had this issue with a similarly-named project, so why is it raising an issue now?

注意:我尝试在Visual Studio中对其进行签名,但仍然没有工作。我想知道这是否可能是权限问题。我使用了不同的用户凭据,并且能够添加一个程序集。问题是我加载了VS解决方案,并且该项目对程序集进行了签名。我应该只创建一个密钥对吗?

NOTE: I tried signing it in Visual Studio and it still doesn't work. I wonder if it might be a permission issue. I used different user credentials and was able to add an assembly. The catch is that I loaded a VS Solution, and that project signed the assembly. Should I just create a key pair?

只有强名称的程序集才能安装到GAC中。有关如何创建强名称程序集的信息,请参见如何:用强名称签名程序集。

Only strong-named assemblies can be installed into the GAC. For information about how to create a strong-named assembly, see How to: Sign an Assembly with a Strong Name.