[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C-sharp question: Failure adding assembly ... Strong name cannot be verified for delay-signed assembly

On 16/10/15 22:15, Gert Wollny wrote:
> Dear all, 
> I'm currently packaging a new version of gdcm [1], it uses swig 3.0 to
> create the c-sharp bindings and all compiles fine. 
> When packaging I get 
>   dh_makeclilibs: 
>    debian/libgdcm-cil/usr/lib/cli/gdcm-sharp-2.6/gdcm- sharp.dll 
>      has no valid signature, ignoring
> Then, when I try to install the *-cli packages the post-install script
> fails with 
> * Installing 1 assembly from libgdcm-cil into Mono
> E: installing Assembly /usr/lib/cli/gdcm-sharp-2.6/gdcm-sharp.dll   
>   failed
> E: Installation of libgdcm-cil with 
>     /usr/share/cli-common/runtimes.d/mono failed
> After some digging I think now that the actual command that is executed
> is 
>   gacutil -i /usr/lib/cli/gdcm-sharp-2.6/gdcm-sharp.dll
> and it fails with
>   Failure adding assembly /usr/lib/cli/gdcm-sharp-2.6/gdcm-sharp.dll to
>   the cache: Strong name cannot be verified for delay-signed assembly

This happens if you try to install a library systemwide (with gacutil)
which is not properly signed.

> I notes that in the old version of libgdcm-cil (2.4) there is a file
> clilibs in the deb://DEBIAN/ directory that is missing in my new
> package. I assume that this is some kind of signature. The old package
> also has the same postinst script that installs the package in the gac.
> The old package used mummy/activiz.net[2] to create the c-sharp
> bindings, but it is currently not possible to use this tool, because
> mummy doesn't work with g++>=5, so I'm stuck with using swig. I don't
> know if that has any influence though, because in the end these are
> just tools to create the C# source files. 
> Then there is also the problem that the key file
> Wrapping/Csharp/key.snk is without a source. 

This file is a cryptographic signing key, source wouldn't be meaningful
for it. The key is provided, because the signature is part of the ABI of
the library.

> Now, I am completely new to C#, and this is the first time I touched
> this package, so any hint what I can to do to resolve this? 
> My other option is to simply disable the C# bindings (there are no
> revese dependencies). 
> The current packaging is done with svn in [3], the original code for
> the bindings is in Wrapping/Csharp, and I added a patch   
>    d/p/add-csharp-keyfile-from-commandline.patch
> that moves the keyfile from the assembly to the command line. I also
> tried the "delayed sign" option but to no avail (i.e. I'm really flying
> blind here).  

What does "sn -T /path/to/gdcm-sharp.dll" report? "sn" is the tool for
looking at and manipulating signatures on C# compiled output, check the
flags with "sn -h sn"

Reply to: