views:

75

answers:

2

Is there a framework, that makes the use of of Reflection.Emit easier? Something I can tell: Give me a class with a string field and get,set accessors.

The code I find in Create a class type in code in .net c# is what I need, but it is somewhat cryptic. I think a library with a simplified interface would boost productivity.

+4  A: 

I think you just described CodeDOM. Unfortunately, it doesn't really (IMO) make it easier - it just makes it... different.

Personally, I'd just use TypeBuilder, ILGenerator and encapsulate the common functionality I need, i.e.

PropertyBuilder CreateProperty(TypeBuilder type, string name, Type propertyType)
{...}

Meta-programming is rarely simple, but from that detail you get a very good understanding of what is actually happening.

Marc Gravell
I'll certainly have a look at CodeDOM. From the first impression, it is appealing to me.
Frank Michael Kraft
+3  A: 

Have a look at the CCI.

leppie
CCI is certainly an option, that I will consider. Thanks.
Frank Michael Kraft