8000 allow dup behaviour different to ilmerge · Issue #414 · gluck/il-repack · GitHub
[go: up one dir, main page]

Skip to content

allow dup behaviour different to ilmerge #414

Open

Description

@zivkan

I'm not sure if il-repack intends to be a drop-in replacement for ilmerge. I had a quick look at the readme and the wiki, and I can't find a migration guide or known differences list.

I tried to migrate NuGet.exe from ILMerge to il-repack: NuGet/NuGet.Client#6733

Tests that ran the merged/repacked nuget.exe were failing, relating to a type provided in /AllowDup.

It turns out NuGet.exe uses NuGet.Core.dll which has an old implementation of NuGetFramework, and the repo contains the current implementation in the NuGet.Frameworks project. Basically, it appears that ilmerge was taking NuGetFramework from NuGet.Frameworks.dll, whereas ilrepack.exe was taking it from NuGet.Core.dll, given all the same arguments.

We were generating the ilmerge/ilrepack arguments from an MSBuild <BuildArtifacts Include="$(OutDir)\*.dll" />, so taking them alphabetically, hence ilmerge was taking the later assembly with the AllowDup types, but ilrepack was taking the first. I didn't validate what happens with ilmerge's output after moving NuGet.Core.dll's order, but after moving it ilrepack.exe appears to be building a nuget.exe that is passing tests that failed previously.

Activity

  1. KirillOsenkov commented on Aug 26, 2025

    @KirillOsenkov
    Collaborator

    I'd say just specify all assemblies to be merged explicitly and in the correct order, it will help with the determinism.

  2. zivkan commented on Aug 26, 2025

    @zivkan
    Author

    What is the "correct order"? The order that worked for ilmerge doesn't work for ilrepack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0