locked
how to disable the autorun feature for t4 templates in Visual Studio 2012 RRS feed

  • Question

  • User2128776521 posted

    Dear Developers --

    Please help.

    I need to know how to disable the autorun feature for t4 templates in Visual Studio 2012.

    (In case you did not know, Visual Studio will autorun all t4 templates as soon they are changed and saved in the IDE.)

    I want to only run the templates only when I choose > Build, > Transform All Templates.

    (I know that I can manually clear the CustomTool property and then fill it in again when I need to run them-- but that is not a feasible solution for use becuase it is a manual process, it is error prone, it requires excessive work to turn on and turn off, we use t4 in a lot of different projects, etc, etc.)

    Do you know of a way to turn off the autorun, automatic transformation, of t4 templates in Visual Studio?

    Please advise.

    Thanks.

    -- Mark Kamoski

    Tuesday, February 19, 2013 2:16 PM

Answers

  • User-166373564 posted

    Hi mkamoski

    As you said above, to disable T4 template auto-run in Visual Studio 2012, we could delete TextTemplatingFileGenerator under "Custom Tool" in the file's Properties while we edit it, and then fill it in again.

    I would like to be able to switch this back-and-forth from "manual transform mode" and "auto transform mode", but it appears the Visual Studio is not that smart (yet)--

    I think you could consider submitting idea to Visual Studio 2012 Feedback(https://connect.microsoft.com/VisualStudio), 

    Microsoft engineers will evaluate this issue seriously, and they will give positive response for this.  Thanks

    With regards

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 26, 2013 1:00 AM

All replies

  • User-134477160 posted

    If that's an Add-in, plz just remove it from Vs

    Tuesday, February 19, 2013 10:22 PM
  • User2128776521 posted

    If that's an Add-in, plz just remove it from Vs

    This is not an add-in or extension or anything like that.

    The behaviour (to auto-run/auto-transform a t4 template every time that the t4 template is changed and saved) is intrinsic default behaviour in Visual Studio 2012-- that is the "standard" way that Visual Studio handles such things.

    The problem is that if there are a lot of templates, and if the templates each take 10-20 seconds to run, and if one is doing a lot of changes to the t4 templates during a development/testing cycle, and etc-- then it take a LONG time to wait for Visual Studio to transform the t4 templates after each and every save.

    I would like to be able to switch this back-and-forth from "manual transform mode" and "auto transform mode", but it appears the Visual Studio is not that smart (yet)-- unless someone has a workaround.

    What do you think?

    Please advise.

    Thanks.

    -- Mark Kamoski

    Wednesday, February 20, 2013 9:49 AM
  • User-166373564 posted

    Hi mkamoski

    As you said above, to disable T4 template auto-run in Visual Studio 2012, we could delete TextTemplatingFileGenerator under "Custom Tool" in the file's Properties while we edit it, and then fill it in again.

    I would like to be able to switch this back-and-forth from "manual transform mode" and "auto transform mode", but it appears the Visual Studio is not that smart (yet)--

    I think you could consider submitting idea to Visual Studio 2012 Feedback(https://connect.microsoft.com/VisualStudio), 

    Microsoft engineers will evaluate this issue seriously, and they will give positive response for this.  Thanks

    With regards

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 26, 2013 1:00 AM
  • User2128776521 posted

    Dear Angie --

    To send a wish-list idea to the Visual Studio IDE Development Team was a good idea.

    I appreciate that you mentioned it.

    Now they have the suggestion.

    Thanks.

    -- Mark Kamoski

    Tuesday, February 26, 2013 9:27 AM