0

Possible Duplicate:
How to get t4 files to build in visual studio?

At build time I would like to somehow generate C# classes that will then be picked up and compiled into the binary.

I have a lot of almost identical accessor objects I need to create, each with a different name. The names of these objects is available in an xml config file as part of the project. At compile time, these objects need to be created such that they can exist within the DLL at runtime.

I have investigated T4 templates, but that appears to be post compile time, and only 1 class object is created per template which really doesn't remove the poiler plate.

Any tips would be great! -Sheldo

Community
  • 1
  • 1
flacnut
  • 1,030
  • 4
  • 11
  • 21
  • Since the primary part of your question was a duplicate, I closed it as such. To answer the second implied part, you can of course output as many classes you want from a T4 file. With the out-of-the-box installed T4 system, they'll all end up in one big file, but with the [T4 toolbox](http://t4toolbox.codeplex.com/) you can easily split that into several files. However, I would caution against something which modifies the project file at compile-time, you should only output multiple files if you intend to run the tool manually. – Lasse V. Karlsen Oct 13 '11 at 08:04
  • Appretiated :) I may have to look at re-engineering my code since compiletime is the only option. – flacnut Oct 13 '11 at 08:22

0 Answers0