由于名称失败,无法将从ASP.Net(4.5)网站创建的程序集添加到GAC [英] Unable to add an assembly created from ASP.Net (4.5) web site to GAC due to strong name failure

查看:78
本文介绍了由于名称失败,无法将从ASP.Net(4.5)网站创建的程序集添加到GAC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我创建了一个ASP.Net 4.5 Empty网站,我需要一个程序集作为输出,需要在GAC中部署。在那,我已经将MSBuild项目属性选项更新为"使用固定命名和单页组件"。和"在预编译的程序集上启用
强命名"。我还使用了一个使用强名称工具生成的密钥文件,并且我使用了一个有效的文件位置来获取snk文件。



在发布本网站时,我使用过"Web部署包"具有.zip文件的有效位置的选项。另外,我已经设置了"将所有输出合并到单个组件"。并且"将其视为库组件"。我还取消选中
"允许预编译的站点可更新。"我还取消选中了从App_Data文件夹中排除文件的选项。



尽管如此,在我发布之后,我无法将此程序集添加到GAC,提取的拉链。我在命令行中收到错误,说"未能将程序集添加到缓存:尝试安装没有强名称的程序集"。
我无法弄明白,我做错了什么。有人可以帮忙吗?

Hi,

I have created an ASP.Net 4.5 Empty website from which I need an assembly as output, which needs to be deployable in GAC. In that, I have updated the MSBuild project property option to "Use Fixed Naming and Single Page Assemblies" and "Enable Strong Naming on Precompiled Assemblies". I have also used a Key File generated with a Strong Name tool and I have used a valid file location for the snk file.

While publishing this website, I have used "Web Deploy Package" option with a valid location for the .zip file. Also, I have set "Merge all outputs to a single assembly" and "treat this as a library component". I have also unchecked "Allow pre-compiled site to be updatable." I have also unchecked the option to exclude files from App_Data folder.

In spite of all this, after I published, I am unable to add this assembly to GAC, from the extracted zip. I am getting an error in the command line, saying, "Failure to add assembly to cache: Attempt to install an assembly without a strong name." I am not able to figure out, what I am doing wrong. Can anyone please help?

推荐答案

Hello Ven,

Hello Ven,

从您的描述中,您似乎使用了Visual安装程序集的Studio,我用你的描述创建了一个测试,我发现生成的dll实际上没有强名称,因此当试图将它部署到GAC时,它说程序集
没有强命名。由于网站汇编没有强烈命名的原因,我建议您可以将其发送到网站相关论坛:

From your description, it seems that you use the Visual Studio to install the assembly, I created a test with your description, and I found the generated dll is actually does not strongly named, so that when trying to deploy it to the GAC, it says the assembly is not strongly named. For the reason why the website assembly is not strongly named, I suggest that you could ask it to the web site related forum as:

http://forums.asp.net/

问候。


这篇关于由于名称失败,无法将从ASP.Net(4.5)网站创建的程序集添加到GAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆