[GH-ISSUE #72] Writing mixed-mode assemblies is not supported #62

Closed
opened 2026-02-25 21:30:35 +03:00 by kerem · 3 comments
Owner

Originally created by @kuhnboy on GitHub (Sep 27, 2022).
Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/72

Originally assigned to: @brutaldev on GitHub.

Running into this error with mixed-mode assemblies with 3.1.0.

1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error : NotSupportedException: Writing mixed-mode assemblies is not supported
1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error :    at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error :    at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error :    at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error :    at Brutal.Dev.StrongNameSigner.AssemblyInfo.Save(String assemblyPath, Byte[] keyPair)
1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error :    at Brutal.Dev.StrongNameSigner.SigningHelper.SignAssemblies(IEnumerable`1 assemblyInputOutputPaths, String keyFilePath, String keyFilePassword, String[] probingPaths)
1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error :    at Brutal.Dev.StrongNameSigner.AutomaticBuildTask.Execute()
1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error :

It is implied that this is fixed in 3.1.0 (https://github.com/brutaldev/StrongNameSigner/pull/67)

Originally created by @kuhnboy on GitHub (Sep 27, 2022). Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/72 Originally assigned to: @brutaldev on GitHub. Running into this error with mixed-mode assemblies with 3.1.0. ``` 1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error : NotSupportedException: Writing mixed-mode assemblies is not supported 1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error : at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters) 1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error : at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters) 1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error : at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters) 1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error : at Brutal.Dev.StrongNameSigner.AssemblyInfo.Save(String assemblyPath, Byte[] keyPair) 1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error : at Brutal.Dev.StrongNameSigner.SigningHelper.SignAssemblies(IEnumerable`1 assemblyInputOutputPaths, String keyFilePath, String keyFilePassword, String[] probingPaths) 1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error : at Brutal.Dev.StrongNameSigner.AutomaticBuildTask.Execute() 1> <<redacted>>\packages\Brutal.Dev.StrongNameSigner.3.1.0\build\Brutal.Dev.StrongNameSigner.targets(6,5): error : ``` It is implied that this is fixed in 3.1.0 (https://github.com/brutaldev/StrongNameSigner/pull/67)
kerem 2026-02-25 21:30:35 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@brutaldev commented on GitHub (Sep 27, 2022):

@kuhnboy Mono.Cecil is clearly not happy about the assembly you are using.
You will need to provide me with the assembly you are trying to sign that causes that exception so I can reproduce and attempt to fix it.

The issue you refer to was the detection of mixed-mode and skipping them. Signing will not be supported for them, but if it can be detected they can be skipped and the error can be avoided. Whatever assembly you are trying to sign there clearly fails to identify as being mixed-mode so it attempts to sign it and fails.

<!-- gh-comment-id:1260023928 --> @brutaldev commented on GitHub (Sep 27, 2022): @kuhnboy Mono.Cecil is clearly not happy about the assembly you are using. You will need to provide me with the assembly you are trying to sign that causes that exception so I can reproduce and attempt to fix it. The issue you refer to was the detection of mixed-mode and skipping them. Signing will not be supported for them, but if it can be detected they can be skipped and the error can be avoided. Whatever assembly you are trying to sign there clearly fails to identify as being mixed-mode so it attempts to sign it and fails.
Author
Owner

@kuhnboy commented on GitHub (Sep 27, 2022):

Ok thanks. So the correct answer is:

  • Skipping mixed mode assemblies was broken but should be fixed in 3.1.1.
  • There is no support for mixed mode assembly signing due to Cecil not supporting it.
<!-- gh-comment-id:1260178381 --> @kuhnboy commented on GitHub (Sep 27, 2022): Ok thanks. So the correct answer is: - Skipping mixed mode assemblies was broken but should be fixed in 3.1.1. - There is no support for mixed mode assembly signing due to Cecil not supporting it.
Author
Owner

@brutaldev commented on GitHub (Oct 17, 2022):

Fixed and deployed to NuGet: https://www.nuget.org/packages/Brutal.Dev.StrongNameSigner/3.1.1

<!-- gh-comment-id:1280769547 --> @brutaldev commented on GitHub (Oct 17, 2022): Fixed and deployed to NuGet: https://www.nuget.org/packages/Brutal.Dev.StrongNameSigner/3.1.1
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/StrongNameSigner#62
No description provided.