4

The tt template contains following code:

    var visualStudio 
        = (this.Host as IServiceProvider)
        .GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;

Editing tt from Visual Studio triggers code generation. In this case, the visualStudio variable is not null.

However, visualStudio variable is null, when same tt is run manually via calling TextTransform.exe from command line.

Is it possible to obtain EnvDTE.DTE when TextTransform.exe is run manually? If so, how is it possible to do that?

Andrey K.
  • 665
  • 8
  • 29
  • 2
    you can search or activate a host and use that instance as host of the template: https://www.viva64.com/en/b/0169/ –  Jul 03 '19 at 09:52

0 Answers0