dotnet / ILMerge

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

Command line documentation does not appear to be correct. #53

Open BrainSlugs83 opened 5 years ago

BrainSlugs83 commented 5 years ago

1.) According to the command line documentation, it sounds like "/closed" will automatically merge direct and indirect references into the executable. That does not appear to be the case.

2.) According to the command line documentation /internalize:"path\to\file.dll" should cause the file to be excluded, but that also does not appear to be the case.

3.) Additionally, the output (warning?) message that a non-.net assembly will be skipped, but the rest of the arguments will be processed, is a giant lie. -- it literally just stops and doesn't do anything.

This command demonstrates the first behavior:

"D:\path\to\ILMerge.exe" /closed /out:"D:\temp\derp\merged.exe" "D:\TEMP\FOOP\input.exe"

Input.exe has over 200 references, and combined they're over 120 MB... but the resulting output file is only 12 KB, and launching it as a standalone generates an error about missing references, immediately.

This command demonstrates the second two behaviors:

"d:\path\to\ILMerge.exe" /wildcards /internalize:"D:\TEMP\FOOP\DocumentDB.Spatial.Sql.dll" /closed /out:"D:\temp\derp\merged.exe" "D:\TEMP\FOOP\Input.exe" "D:\TEMP\FOOP\*.dll"
An exception occurred during merging:
ILMerge.Merge: Could not load assembly from the location 'D:\TEMP\FOOP\DocumentDB.Spatial.Sql.dll'.
Skipping and processing rest of arguments.
   at ILMerging.ILMerge.Merge()
   at ILMerging.ILMerge.Main(String[] args)

Even though it says it will skip that file and keep going, it doesn't; it just stops, it doesn't even output the exe with the missing references (like the first command does). -- Secondly, the exclude directive ("internalize") has no effect. It's clearly still trying to include that file. :(

Is there any alternative to make this work? -- I really don't want to have to add ~270 input files to the command!!