brutaldev / StrongNameSigner

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

Writing mixed-mode assemblies is not supported #42

Closed chambm closed 2 years ago

chambm commented 7 years ago

Is it possible to overcome this if the mixed-mode assembly is unsigned? I'm trying to use the default "sign everything in the project" approach so I don't have to add a build step to specify a myriad of pure .NET DLLs to exclude a few.

brutaldev commented 7 years ago

By default it's going to try and sign everything that is unsigned and will try to load all assemblies it finds even if that results in loading in mixed-mode or even unmanaged assemblies in the process.

As a feature you could add a negation option to the console application (! prefix) so you can provide directories to include as well as exclude to simplify your input parameters and directory selection process.

psandhu79 commented 6 years ago

does the sn tool not support signing mixed mode assemblies ?

brutaldev commented 6 years ago

@psandhu79 SN.exe can't sign any assemblies after they've been built unless they are marked for delay signing.

psandhu79 commented 6 years ago

the mixed mode assmblies are delay signed.

brutaldev commented 6 years ago

@psandhu79 Then sign them with sn.exe... What relevance does this have to the issue of not being able to strong-name sign third party mix-mode assemblies that are not delay signed? The .NET assemblies being referred to in this issue are not delay signed so using sn.exe is not useful.

psandhu79 commented 6 years ago

@brutaldev Let me clarify I am building my own mix-mode assemblies and would like to sign the with your tool. Right now it gives a warning that this cannot be done.

I was wondering why the mix-mode assemblies which are delay signed cannot be signed using your tool ?

brutaldev commented 6 years ago

@psandhu79 The answer should be quite obvious, because it's not supported. This is why this issue aptly titled "Writing mixed-mode assemblies is not supported", is labeled as an enhancement, and is still open.

Adding support for this would mean being able to sign mixed-mode assemblies regardless of whether they are marked for delay signing or not, the support for either does not currently exist in the software so you will not be able to use it for this purpose until this support is added.

brutaldev commented 2 years ago

This works now when using v3.0.6-beta: https://www.nuget.org/packages/Brutal.Dev.StrongNameSigner/3.0.6-beta

brutaldev commented 2 years ago

Official release: https://www.nuget.org/packages/Brutal.Dev.StrongNameSigner/3.1.0