ILMerge 程序集与空格

ILMerge assembly with spaces

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

命令行输入:

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

任何人都可以提供任何帮助,我们将不胜感激。

你试过像其他命令行参数一样用空格引用它吗?

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