-1

I'm trying to use ILMerge to create a single executable to distribute and I'm having some difficulty because my application has spaces in the filename. It appears that ILMerge uses a space a delimiter to specify multiple input assemblies. This means there are assemblies that it can't find (because they don't exist obviously) but I'm been unable to find any combination of quotes and double-quotes to tell ILMerge to ignore the spaces.

Command Line Input:

/out:bin\Debug\My Application.exe /targetplatform:v4,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5" "obj\Debug\My Application.exe" "C:\Users\Username\source\repos\CompanyInternal\My Application\My Application\Newtonsoft.Json.dll" "C:\Users\Username\source\repos\CompanyInternal\My Application\My Application\Renci.SshNet.dll" /log"

Command Line Output:

The list of input assemblies is:
    My
    Application.exe
    obj\Debug\My Application.exe
    C:\Users\Username\source\repos\CompanyInternal\My Application\My Application\Newtonsoft.Json.dll
    C:\Users\Username\source\repos\CompanyInternal\My Application\My Application\Renci.SshNet.dll
Could not find the file 'My'.
An exception occurred during merging:
ILMerge.Merge: Could not find the file 'My'.
   at ILMerging.ILMerge.Merge()
   at ILMerging.ILMerge.Main(String[] args)

Any help anybody can provide would be greatly appreciated.

Chris
  • 733
  • 1
  • 5
  • 19
  • have you tried quoting it like the rest of the command line parameters with spaces? – Michael Coxon Nov 17 '17 at 16:10
  • Yes. I shared my command line above and it is in double quotes. It seems it only splits on spaces for the first InputAssembly argument, and not any others. – Chris Nov 17 '17 at 16:12
  • You have to put "double quotes" around the path name. Just like you did for all the other arguments. – Hans Passant Nov 17 '17 at 16:16
  • i.e.: `/out:"bin\Debug\My Application.exe" /targetplatform:v4,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5" "obj\Debug\My Application.exe" "C:\Users\Username\source\repos\CompanyInternal\My Application\My Application\Newtonsoft.Json.dll" "C:\Users\Username\source\repos\CompanyInternal\My Application\My Application\Renci.SshNet.dll" /log"` – Michael Coxon Nov 17 '17 at 16:17
  • @MichaelCoxon: That did it! Can you please post as answer so I can upvote? – Chris Nov 17 '17 at 16:27

1 Answers1

0

have you tried quoting it like the rest of the command line parameters with spaces?

i.e.: /out:"bin\Debug\My Application.exe" /targetplatform:v4,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5" "obj\Debug\My Application.exe" "C:\Users\Username\source\repos\CompanyInternal\My Application\My Application\Newtonsoft.Json.dll" "C:\Users\Username\source\repos\CompanyInternal\My Application\My Application\Renci.SshNet.dll" /log"

Michael Coxon
  • 5,311
  • 1
  • 24
  • 51