本文介绍了签名未签名的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NHibernate的2.1的最近的升级带来了一个大型的头痛情况到表面。

这似乎大部分项目的建设被默认设置为签名的程序集。对于例如fluentnhibernate引用的密钥文件fluent.snk。

Nhibernate.search建立从我可以收集签名,也不会建签署的是,如果你引用生成的密钥文件,你的错误:

引用程序集Lucene.Net不具有强名称

这意味着,有nhibernate.search像castle.activerecord项目当你引用的可怕错误的依赖不会建装配nhibernate.search没有强名称:

相当多的项目中使用caslte.activerecord所以它是非常重要的这个版本。

有没有人任何想法在这里做什么,因为我完全没了主意?

这是完全疯狂。

解决方案
  1. 获取MSIL为提供组件从VS.NET命令提示符下,输入以下命令:C:>反汇编providedAssembly.dll /out:providedAssembly.il
  2. 在重命名/移动原装配我只是钉在那些.orig的文件名。
  3. 创建从MSIL输出一个新的组件和程序集密钥文件假设你已经有一个程序集的公钥文件,就从VS.NET命令提示符处键入以下:C:> ILASM providedAssembly.il / DLL /key=keypair001.snk

源代码http://www.andrewconnell.com/blog/archive/2004/12/15/772.aspx

The recent upgrade of NHibernate 2.1 has brought a mega headache situationto the surface.

It seems most of the projects build by default as signed assemblies. Forexample fluentnhibernate references the keyfile fluent.snk.

Nhibernate.search builds unsigned from what I can gather and will not buildsigned that is if you reference a generated keyfile, you get the error:

Referenced assembly 'Lucene.Net' does not have a strong name

This means projects like castle.activerecord that have nhibernate.search asa dependency will not build as you get the horrendous error referencedassembly nhibernate.search does not have a strong name:

Quite a few projects use caslte.activerecord so it is quite important thatthis builds.

Has anyone any idea what to do here as I am totally out of ideas?

This is complete madness.

解决方案
  1. Obtain the MSIL for the provided assemblyFrom a VS.NET command prompt, enter the following:c:>ildasm providedAssembly.dll /out:providedAssembly.il
  2. Rename/move the original assemblyI just tack on ".orig" to the filename.
  3. Create a new assembly from the MSIL output and your assembly keyfileAssuming you already have an assembly key pair file, do the following from a VS.NET command prompt:c:>ilasm providedAssembly.il /dll /key=keypair001.snk

Source http://www.andrewconnell.com/blog/archive/2004/12/15/772.aspx

这篇关于签名未签名的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 09:10