Why does my T4 template append a number to the file name?

前端 未结 2 1321
耶瑟儿~
耶瑟儿~ 2020-12-28 12:03

Why do my T4 templates sometimes append a number to the output file and sometimes not? For instance, in one case I might have a template file called Foo.tt and

2条回答
  •  余生分开走
    2020-12-28 12:40

    @itowlson's answer really helped me out, but I discovered a slightly simpler workaround that I thought I'd share.

    If you have:

    Filename.tt
    └── Filename1.cs
    

    Just rename Filename.tt to Filename2.tt:

    Filename2.tt
    └── Filename2.cs
    

    And back to Filename.tt again:

    Filename.tt
    └── Filename.cs
    

    Voilà.

提交回复
热议问题