C# 用空格合并程序集

C# 用空格合并程序集,c#,ilmerge,C#,Ilmerge,我试图使用ILMerge创建一个要分发的可执行文件,但我遇到了一些困难,因为我的应用程序的文件名中有空格。ILMerge似乎使用空格作为分隔符来指定多个输入程序集。这意味着有一些程序集找不到(因为它们显然不存在),但我找不到任何引号和双引号的组合来告诉ILMerge忽略空格 命令行输入: /out:bin\Debug\My Application.exe /targetplatform:v4,"C:\Program Files (x86)\Reference Assemblies\Microso

我试图使用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)

任何人能提供的任何帮助都将不胜感激。

您是否尝试过像其他命令行参数一样使用空格引用它


i、 e.:
/out:“bin\Debug\My Application.exe”/targetplatform:v4,“C:\Program Files(x86)\Reference Assembly\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“

您是否尝试过像命令行其他参数一样用空格引用它?是的。我在上面共享了我的命令行,它用双引号引起来。似乎它只在第一个InputAssembly参数的空格上拆分,而不是在任何其他参数上拆分。必须在路径名周围加上“双引号”。就像您对所有其他参数所做的那样。例如:
/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\Newtonsoft.Json.dll”“C:\Users\Username\source\repos\CompanyInternal\My Application\My Application\Renci.SshNet.dll”/log“
@MichaelCoxon:成功了!你能把答案贴出来让我投票吗?