我正在尝试使用ILMerge创建一个使用Windows Azure SDK 2.0的单个可执行文件,包括Microsoft.WindowsAzure.ServiceRuntime.dll
我手动添加的,因为我找不到任何包含它的 NuGET 包。
我在 VS2012 构建后事件中使用以下命令行:
/wildcards /targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /log:ILMerge.log /closed Output.exe *.dll /out:Executable.exe
但是,我收到以下错误ILMerge.log
,即使输出窗口在构建后根本没有报告任何问题:
The assembly 'Microsoft.WindowsAzure.ServiceRuntime' was not merged in correctly. It is still listed as an external reference in the target assembly.
An exception occurred during merging:
ILMerge.Merge: The assembly 'Microsoft.WindowsAzure.ServiceRuntime' was not merged in correctly. It is still listed as an external reference in the target assembly.
at ILMerging.ILMerge.Merge()
at ILMerging.ILMerge.Main(String[] args)
然后可执行文件在打开时抛出以下异常:
System.Reflection.TargetInvocationException: Exception has been thrown by the
target of an invocation. ---> System.IO.FileNotFoundException: Could not load file
or assembly 'msshrtmi, Version=2.0.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35'
or one of its dependencies.
我还测试了没有合并的相同输出,它工作正常。
我在这里想念什么?