mirror of
https://github.com/brutaldev/StrongNameSigner.git
synced 2026-04-25 03:16:10 +03:00
[PR #104] [MERGED] Update custom attribute fixing to include every custom attribute #109
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/brutaldev/StrongNameSigner/pull/104
Author: @Chri-s
Created: 7/19/2025
Status: ✅ Merged
Merged: 7/22/2025
Merged by: @brutaldev
Base:
master← Head:more-custom-attributes📝 Commits (1)
0216f8fUpdate custom attribute fixing to include every custom attribute📊 Changes
10 files changed (+401 additions, -38 deletions)
View changed files
📝
src/Brutal.Dev.StrongNameSigner.TestAssembly.A/A.cs(+35 -1)📝
src/Brutal.Dev.StrongNameSigner.TestAssembly.A/Brutal.Dev.StrongNameSigner.TestAssembly.A.csproj(+1 -0)➕
src/Brutal.Dev.StrongNameSigner.TestAssembly.A/CustomTypeAttribute.cs(+18 -0)📝
src/Brutal.Dev.StrongNameSigner.TestAssembly.A/Properties/AssemblyInfo.cs(+2 -1)➕
src/Brutal.Dev.StrongNameSigner.Tests/AppDomainAssemblyTester.cs(+87 -0)📝
src/Brutal.Dev.StrongNameSigner.Tests/Brutal.Dev.StrongNameSigner.Tests.csproj(+1 -0)📝
src/Brutal.Dev.StrongNameSigner.Tests/SignAssemblyTests.cs(+122 -0)📝
src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.A.dll(+0 -0)📝
src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.A.pdb(+0 -0)📝
src/Brutal.Dev.StrongNameSigner/SigningHelper.cs(+135 -36)📄 Description
This pull request adds support for handling custom attributes with type references at all levels in signed assemblies, including assembly, module, type, and method levels. It also adds test coverage to validate these changes.
Previously, custom attributes containing type references were only updated at the assembly level during signing. This limitation caused issues when attributes referencing types from other assemblies appeared at other levels.
In the System.Waf project, the class MefSettingsService uses an
[Export(typeof(ISettingsService))]attribute.ISettingsServiceis defined in a separate assembly (System.Waf.Core). When both System.Waf.Wpf and System.Waf.Core are signed, the ExportAttribute in System.Waf.Wpf still points to the unsignedISettingsService, because the attribute was not updated during signing.As a result, MEF fails to resolve the export and throws an exception at runtime.
With this PR, type references inside custom attributes across all levels will be correctly updated to reference the signed assemblies. This ensures MEF resolves types correctly after signing.
To add tests for this, I had to update the Brutal.Dev.StrongNameSigner.TestAssembly.A.dll file. If you don't want to trust my updated binary file, you can recompile the TestAssembly.A project and copy that dll to the TestAssemblies folder.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.