Merging .dll with .exe

Rodrigues Ighor picture Rodrigues Ighor · Jan 27, 2013 · Viewed 8k times · Source

I'm trying to merge CabalMain.exe with crckd.dll I downloaded ilmerge, and went into >Program giles (x86)>Microsoft > Ilmerge I then did this.

    C:\Program Files (x86)\Microsoft\ILMerge>ilmerge CabalMain.exe crckd.dll /out:me
    rged.exe
    An exception occurred during merging:
    ILMerge.Merge: Could not load assembly from the location 'C:\Program Files (x86)
    \Microsoft\ILMerge\CabalMain.exe'. Skipping and processing rest of arguments.
       at ILMerging.ILMerge.Merge()

   at ILMerging.ILMerge.Main(String[] args)

Can anyone help me understand what I did wrong?

Answer

vcsjones picture vcsjones · Jan 27, 2013

You need to specify the full path of the files you want to merge, not just their names. Otherwise ILMerge is looking for the in the same directory it is installed in:

C:\Program Files (x86)\Microsoft\ILMerge>ilmerge C:\path\to\your\program\CabalMain.exe C:\path\to\your\program\crckd.dll /out:C:\path\to\your\program\merged.exe

You also probably want to specify a path on out, otherwise it will try to write it into Program Files (which has a good chance of failing due to permissions).