locked
Can't get T4 file to work

    Question

  • Hello,

    I am working on my first windows 8 app and am making use of a web api that talks json. In order to generate the needed classes from the json service description I want to make use of a t4 template. However, no matter what I try, I can't get visual studio express 2012 to recognise the newly created .tt file as a t4 template file. In visual studio 2010 this works fine and Scott Hanselman claims t4 should work great in 2012. What am I doing wrong?

    *edit* I tried adding "TextTemplatingFileGenerator" to the "custom tool" property of my .tt file. When I try to run this, I get the error message "cannot find custom tool 'TextTemplatingFileGenerator' on this system". This is a completely fresh installation of express 2012 (since it's my first metro app). Could it be that any 2010 (Professional edition) components are interfering?


    • Edited by jimmyvh Monday, October 15, 2012 10:36 PM added extra info
    Monday, October 15, 2012 6:01 PM

Answers

  • I just installed Visual Studio Express 2012 'For Windows Desktop' instead of 'For Windows 8'. In this version, creating and using .tt files is no problem at all. Seems the windows 8 metro edition of VS Express is bugged in this regard. Ill just generate the library I need in the other version then.
    • Marked as answer by jimmyvh Wednesday, October 17, 2012 9:25 AM
    Tuesday, October 16, 2012 6:42 PM

All replies

  • Your VS 2010 components shouldn't affect this. I suspect the problem is that you are using the Express SKU. Can you load the file successfully if you use Visual Studio 2012 Professional (Free Trial) ?

    --Rob

    Tuesday, October 16, 2012 4:48 PM
    Owner
  • I just installed Visual Studio Express 2012 'For Windows Desktop' instead of 'For Windows 8'. In this version, creating and using .tt files is no problem at all. Seems the windows 8 metro edition of VS Express is bugged in this regard. Ill just generate the library I need in the other version then.
    • Marked as answer by jimmyvh Wednesday, October 17, 2012 9:25 AM
    Tuesday, October 16, 2012 6:42 PM