tags:

views:

264

answers:

2

Hi,

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

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

Nhibernate.search builds unsigned from what I can gather and will not build signed 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 as a dependency will not build as you get the horrendous error referenced assembly nhibernate.search does not have a strong name:

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

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

This is complete madness.

Cheers

Paul Cowan

+1  A: 

The thing is, you cannot reference non-strong-named assemblies from strong-named assemblies, but you can do the reverse. That's why every decent project out there should be signed.

When I run into that problem, I drop a line at the project author (or register an issue) with the explanation in my comment above, and while I wait for a fix, I compile and sign it myself.

Martinho Fernandes
+1. Yeah, the options are either take control yourself and sign, or make all of your stuff unsigned (which isn't usually a good choice).
RichardOD
+4  A: 
  1. Obtain the MSIL for the provided assembly From a VS.NET command prompt, enter the following: c:>ildasm providedAssembly.dll /out:providedAssembly.il
  2. Rename/move the original assembly I just tack on ".orig" to the filename.
  3. Create a new assembly from the MSIL output and your assembly keyfile Assuming 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

Dve