【发布时间】:2015-09-18 15:27:29
【问题描述】:
我们在构建服务器上有一个步骤,可以将我们的 DLL 合并为一个以便于传输。
在我们的 QA 环境中,运行 ILMerge 时出现以下错误
An exception occurred during merging:
Key needs to be greater than 0.
Parameter name: key
at System.Compiler.TrivialHashtable.get_Item(Int32 key)
at System.Compiler.Ir2md.GetTypeSpecIndex(TypeNode type)
at System.Compiler.Ir2md.GetMemberRefIndex(Member m)
at System.Compiler.Ir2md.GetMethodToken(Method m)
at System.Compiler.Ir2md.VisitConstruct(Construct cons)
at System.Compiler.Ir2md.VisitAssignmentStatement(AssignmentStatement assignment)
at System.Compiler.Ir2md.VisitBlock(Block block)
at System.Compiler.Ir2md.VisitBlock(Block block)
at System.Compiler.Ir2md.VisitMethodBody(Method method)
at System.Compiler.Ir2md.VisitMethod(Method method)
at System.Compiler.Ir2md.VisitClass(Class Class)
at System.Compiler.Ir2md.VisitModule(Module module)
at System.Compiler.Ir2md.SetupMetadataWriter(String debugSymbolsLocation)
at System.Compiler.Ir2md.WritePE(Module module, String debugSymbolsLocation, BinaryWriter writer)
at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName)
at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
at ILMerging.ILMerge.Merge()
at ILMerging.ILMerge.Main(String[] args)
任何想法如何解决这个问题?我们有太多的代码和太多的 DLL,因此我无法提供有关我们正在尝试合并的 DLL 的更多信息。
被合并的代码是今天早上从我们的开发线分支出来的——代码与开发线相同,可以很好地进行 ILMerge。
合并错误发生在我们的本地机器以及我们的构建服务器上。
我知道这没什么好做的,但这就是我所拥有的一切!
在 Release 模式下构建代码后,IL 合并工作正常。
【问题讨论】: