I am having a case in which I need to generate two CSharp code files with pretty the same code but different namespace of the input and output types of the methods. In fact each
or you could use the T4 Toolbox (Old CodePlex project, New GitHub project) and use the helpers to generate multiple files.
The author, Oleg Sych, has a documentary blog post (Archived version)
Or if you don't want this dependency just for this functionality, you can use the T4 file MultiOutput.tt (Archived version)