Difference between IKVM.Reflection.Emit and Mono.Cecil
Asked Answered
D

1

12

IKVM.Reflection.Emit has "the ability to read and emit .NET 1.1, .NET 2.0 and .NET 4.0 assemblies (while running on, for example, .NET 2.0).".

Does Mono.Cecil have the same? Are they interchangable for this use case? Are they both supported nowadays? What are key differences between them (in emitting IL)?

Delacroix answered 21/10, 2015 at 11:30 Comment(0)
M
4

I know this has been an old question, but I'd like to provide an answer. IKVM.Reflection.Emit API was invented when its author was tired of System.Reflection.Emit and Cecil.Reflection.Emit. In order to make IKVMC compiler faster, he worked from scratch to design this new API.

The history can be found from the following blog posts,

2008 Aug Switch from Microsoft .NET reflection to Cecil

2008 Nov Switch from Cecil to IKVM.Reflection.Emit

2010 Jan Announce IKVM.Reflection

So generally speaking IKVM.Reflection and Cecil have similar functionalities, and IKVM.Reflection API should be faster in many ways.

Up-to-now you can still see Cecil is widely used in many utilities (such as Obfuscar, an obfuscation tool I am maintaining). IKVM.Reflection is mainly used in Mono C# compiler and IKVM itself, and I am not sure whether there are other projects using it (but should be many).

Moony answered 31/12, 2016 at 13:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.