At the moment I am using C# T4 code generation, but as much as I know it is limited to a class file or other file type generation. I need to generate multiple projects in one solution is it possible to accomplish with T4 templates or there is other technique do to this?
-
I am not sure if this will help you. This link shows how to include a MVC project into another MVC project by creating .cs class files for each view and then it is able to be compiled into an assembly for another project. http://stackoverflow.com/questions/6656843/how-to-reuse-areas-controllers-views-models-routes-in-multiple-apps-or-websi – Valamas Apr 11 '14 at 09:26
-
More than a T4 template shouldn't that be a project wizard? – Adriano Repetti Apr 11 '14 at 09:30
-
What solution did you find? Don't hesitate to post your own answer if applicable :) – samy May 14 '14 at 08:58
2 Answers
Templates in Visual Studio allow for multiple projects / files templates so you can definitely create this.
The way to create them is simply to setup the skeleton you need for the project, then replace the content of the files in the directory with specific values that will be replaced when the template has the information needed.

- 14,832
- 2
- 54
- 82
I had similar experience.
I developed a whole set of T4 templates to generate a solution. But once you want change code in multiple files, some code may mess up.
So I wrote a code generator based on database schema to generate a VS solution with DAL(Linq To SQL, Entity Framework), BLL, WCF, and UI Applications MVC, WPF, Windows PHone, Windows App Store, Silverlight.
You can goto https://github.com/ntierontime/Log4Net to see whether it meets your architecture requirements, or not. And send me an email with the .dbml(Linq To Sql Classes).

- 11
- 2