Practical Programming Pearls For .NET Developers

CodeDOM

The CodeDOM is .NET's mechanism for generating code at runtime.  The CodeDOM exposes most of the .NET language features.  Using the CodeDOM you can generate source code in any .NET language that provides a code provider.  Using the CodeDOM you can generate either source code files or assemblies.

The CodeDOM is used in .NET to generate such things as ASP.NET themes, and ASP.NET pages.  In reality any time you need to generate an assembly you can do so in the CodeDOM although other techniques such as templates and XAML may be more appropriate.

FAQs

Q: How can I generate a region around a block of type members? (Forums) Answer

Q: How can I generate a comment within a type definition? (Forums) Answer

Q: How can I generate a using statement? (Forums) Answer

Q: How can I generate a while statement? (Forums) Answer

Q: How can I generate an empty statement? Answer