带空格的ILMerge程序集

时间:2017-11-17 16:01:28

标签: c# ilmerge

我尝试使用ILMerge创建单个可执行文件进行分发,因为我的应用程序在文件名中有空格,所以我遇到了一些困难。似乎ILMerge使用空格分隔符来指定多个输入程序集。这意味着它有无法找到的程序集(因为它们显然不存在),但是我无法找到任何引号和双引号的组合来告诉ILMerge忽略这些空格。

命令行输入:

/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"

命令行输出:

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)

非常感谢任何人提供的任何帮助。

1 个答案:

答案 0 :(得分:0)

您是否尝试过使用空格的其他命令行参数来引用它?

即:/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"