locked
t4 template code appending RRS feed

  • Question

  •  

    Hi

    I have a file generated from a t4 template file. I also have another t4 template file, now the code generated from this should be appended to the first file only, I does want a new file to be generated.

    How do i do this? well using Microsoft.Practices.RecipeFramework.Extensions.dll will work for me.if so what class should I use in that.

     

    If this is not the solution is there any way of doing that.

     

    Please help me

     

    Regards

    satish kumar P 

    Wednesday, January 9, 2008 9:47 AM

Answers

  • Hi Satish, if you trying to add code to the existing class created with the first template you could use partial classes and create another file with the second template extending the first class using this mechanism.

    If you must add the output of the second template to the first file you should be able to use the output of the transformation (the string value) and manipulate the first created file using FileCodeModel or any other file manipulation API.

    HTH,
    -Adrian
    Wednesday, January 9, 2008 12:11 PM