renegadexx / T4.Helper

28 stars 25 forks source link

FindFolderByName issue, if folder is more than once in the same project #8

Closed Hinni closed 7 years ago

Hinni commented 9 years ago

Is there any other way to find the correct position of my current folder, where the .tt files exists? I have a large folder structure in my project. The method FindFolderByName just consider the First() Item in the same project, if there are more than one ProjectItems. But this must not be the correct folder:

projectA
  folder1
    folder1-1
  folder2
    folder1-1
      template.tt

StartNewFile("AdditionalsFile.cs"), "projectA", "folder1-1");

With this constellation the additional file will be generated in the first folder1-1 and not in the folder where the template is.

The method FindFolderByName should be more precise to find the correct folder. Maybe with a more specific folderName parameter in the StartNewFile method.