Holger
Holger

Reputation: 2652

Building complete Assembly with AssemblyBuilder

When Building a dynamic Assembly with AssemblyBuilder you can create several TypeBuilder instances, and build your type with TypeBuilder.CreateType(). When I have 10 types in my assembly do I have to call this one by one ? Or is there a way to say "create the assembly and 'compile all'".

Since Types might cross reference each other, one Type must be built before the other, therefore a created type is still not a useable type. The Type will be created with references to uncreated Types. If you call CreateType() for each TypeBuilder, everything is fine. Just wondering if there might be simpler way also.

Is there a concept of "Completing" an Assembly, or does it stay always "open" and expects more types to be added ?

Upvotes: 1

Views: 166

Answers (0)

Related Questions