Take a look at the template support added in .NET 3.5 SP1 for dynamic data for ASP.NET. Microsoft has expanded this in .NET 4 to make templating available in web forms as well as in ASP.NET MVC, and supports both page and field templates. The data annotation support introduced for dynamic data is becoming the foundation for automated validation support. Data annotation is an important aspect for Silverlight and WCF RIA services as well.
These features can reduce the work that needs to be done for code generation, as well as make code generators more powerful.
Starting right now, any viable code generation solution needs to take advantage of these features, regardless of whether the code generator is commercial, open source, or a custom application.
UPDATE:
By the way, if you're looking for runtime code generation, you may be more interested in LINQ expression support; you can use LINQ to build expression trees, and compile those into code at runtime.