brutaldev / StrongNameSigner

Strong-name sign third party .NET assemblies without the source code.
https://brutaldev.com/post/net-assembly-strong-name-signer
Other
319 stars 68 forks source link

Issue with MvvmLight #17

Closed habakuk007 closed 9 years ago

habakuk007 commented 9 years ago

Hello, thanks for your tool, it's very helpful for us!

We have a little issue with the libraries of MvvmLight - it touches the assemblies on every compilation and so it took a long time.

After the compilation it says this:

 0 file(s) were strong-name signed.
 82 references(s) were fixed.

You can get the log here: https://mega.nz/#!8JllkaTI!VOpstcjIQrILlXARho9_dY0i0I5CsOTbz2rRVh_Kl1o

And my git tells me that some of the dlls have changed (only GalaSoft.MvvmLight.Extras.dll and GalaSoft.MvvmLight.Platform.dll in the different versions).

I also get several warnings like this ("the format of the executable or the library is wrong"):

>EXEC : warning : Das Format der ausführbaren Datei (.exe) oder der Bibliothek (.dll) ist ungültig.

Can this be fixed?

Best regards! Stefan

brutaldev commented 9 years ago

First thing you need to do is update to version 1.5.1. You are currently using 1.5.0 which corrupts files sometimes when fixing references.

Second, it appears as though you are scanning and signing EVERYTHING in the packages directory, this is obviously going to take some time and can easily be avoided. Rather just selectively sign the packages that are not already signed.

This is described in the Build Process section of the documentation. Identify which packages are not signed and add only the necessary directories to your command with the -in parameter to speed up the build. Example:

<Target Name="BeforeBuild">
  <Exec ContinueOnError="false"
        Command="&quot;..\packages\Brutal.Dev.StrongNameSigner.1.5.1\tools\StrongNameSigner.Console.exe&quot; -in &quot;..\packages\elmah.corelibrary.1.2.2|..\packages\Elmah.MVC.2.1.1&quot;" />
</Target>

MVVM supports all .NET framework versions so you are signing a lot of files that you don't even use. Take a look at what is referenced in your projects and use those directories. This could take a bit of time but the build speed will be worth it.

Ensure you also add any dependency packages that may be referenced by the unsigned ones. Even if the dependencies are already signed, they will need to have references fixed to point to the new signed files, more on this in the Dealing With Dependencies documentation.

habakuk007 commented 9 years ago

Thanks!