T4 template will not transform with build

后端 未结 4 702
一个人的身影
一个人的身影 2021-01-11 09:14

I\'m using VisualStudio Ultimate 2012 (Update 1) on Windows 7. I can get my T4 template to generate a file by: right click [tt file] | run Custom tool. That works g

4条回答
  •  梦毁少年i
    2021-01-11 09:57

    I'm afraid that you can't successfully run templates at build time that make use of the Host variable to get at IDE services like the DTE, as the msbuild T4 host is designed to work both from the command line as well as builds in the IDE, and as such, does not expose the global service provider or DTE to templates. The same is true from texttransform.exe, the simple command-line host.

提交回复
热议问题