It seems that .NET CF is missing the very useful Reflection.Emit. So far, I found this library as an alternative: http://www.codeplex.com/EmitCF.
However it seems to be an abandoned early version, so I'm looking for more options.
Does anyone know of another alternative to Emit? Or perhaps someone used EmitCF and can comment on its status?
BTW, the bigger picture: I'm trying to get Emit for the CF, so that I can get http://dynamic.codeplex.com to work under the CF, so I can optimize the serialization code I'm using (http://www.codeproject.com/KB/XML/GR_CustomXmlSerializer.aspx)
What you need is Cecil (http://mono-project.com/Cecil), a Mono project library to generate and inspect programs and libraries in CIL format. It's actively maintained, does a lot more than Reflection.Emit and it's used in a lot of projects, including some that target .NET CF.
This isn't exactly an answer to your question, but since Reflection.Emit isn't supported in CF, an alternative approach you could take to serialization/deserialization would be to compile your classes into a regular Windows application, and make use of Reflection.Emit to programatically generate serialize and de-serialize methods for each class, which could then be incorporated back into the class in the CF version. Basically, you'd use Reflection.Emit in the full framework for code generation.
This would be more work (and a constant source of more work, of course), but it would perform better than a dynamic, Reflection.Emit-based approach (which doesn't work in CF anyway). Most CF classes will work unchanged in the full framework, although not necessarily, of course.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With