dotnet / ILMerge

ILMerge is a static linker for .NET Assemblies.
MIT License
1.22k stars 168 forks source link

Assembly attributes not copied #96

Open tholesen opened 3 years ago

tholesen commented 3 years ago

My simplified scenario is that I have two .NET 4.8 class libraries: AssemblyA with some logic and AssemblyB with some assembly attributes (e.g. Copyright and Company) that I want copied over into AssemblyA, overwriting any existing duplicate attributes.

When I use /copyattrs option (ilmerge /copyattrs /out:merged.dll AssemblyA.dll AssemblyB.dll), then merged.dll only has the assembly attributes of AssemblyA, no matter if e.g. Copyright is blank or not in AssemblyInfo.cs of AssemblyA. No attributes from AssemblyB are copied over. No errors in log file.

For testing, I have tried using the /attr option (ilmerge /attr:AssemblyB.dll /out:merged.dll AssemblyA.dll) and this works, as it overwrites all attributes in AssemblyA with those in AssemblyB, but I would like the attributes merged instead and was expecting the /copyattrs option to do this for me.

Am I using/understanding it wrong or is there a bug?

Environment: ILMerge, version 3.0.41 Assemblies built as .NET 4.8 class libraries with VS 2019, version 16.8.3 Windows 10, version 20H2