将类型添加到Created ModuleDefinition

时间:2015-11-21 02:36:58

标签: collections types .net-assembly mono.cecil

它并不像看起来那么简单;使用myModule.Types.Add(fully defined type from another module)抛出ArgumentException: "Type already attached!"当从头开始创建模块时,怎么可能? Clear()收集后我得到了同样的异常,甚至删除了默认的空Type。

我也尝试使用Types.CopyTo和各种Array操作,但Collection和Array大小在内部是固定的。扩展它的唯一方法是添加,但附加拒绝类型。

0 个答案:

没有答案