Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autogenerating C# Files

Status
Not open for further replies.

phobe62

Programmer
Jan 30, 2004
22
US
Hello all,
I'd like to ask your opinion on the best way to generate C# files. I've found a freeware app called CodeSmith ( that looks promising, but I haven't been able to look at it very much in depth yet.

The C# files I want to autogenerate include class libraries (like data layers), web pages, and web config files.

Any advice will be appreciated.

Regards,
Nick Saunders
 
You can use the code DOM, but it's very incomplete (no support for a large part of the C# language). See the Microsoft.CSharp namespace.

Otherwise, why not simply use a series of TextWriter.WriteLine() calls?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
do you want to create compiled assemblies dynamically or just code files?

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top