views:

364

answers:

4

Hi,

I have to machines setup to run Visual Studio 2008 (SP1) & NET Framework 3.5 (SP1). If I create a .tt file in a console appliaction on machine #1 it automatically creates the sub .cs file for me, however if I do the exact same on machine #2 then no sub .cs file is created.

I have tried toggeling the "Show All Files" option, restarting visual studio (multiple times), added new .tt files (with the same outcome), tried it in both a C# and a VB.NET project and google is drawing up blanks.

Is it possible for t4 to have been disabled somehow? If so then how the heck do I turn it back on, it's annoying :-)

A: 

Check if the file property CustomTool on machine 2 is TextTemplateFileGenerator.

If this property is empty no tool will be run to generate the cs file.

Davy Landman
A: 

That property is blank on machine 2 and manually typing it in and saving it does not trigger the generation of the cs file either. It's almost as if this tool is not working correctly on the second machine?

At the moment I do not have access to machine 1 (they are split between my home and office) so I cannot compare stuff =(

TheCodeJunkie
I think you should post this as a update on your post or as a comment on my answer, but have you tried right clicking the tt file and choosing run custom tool?
Davy Landman
Yeah it was too long for a comment I think so I ended up making a new post. I'm at home at the moment but I'll check tomorrow from work. However I think I checked for that option on machine 2 and couldnt find it, not even after adding the custom tool propery value
TheCodeJunkie
A: 

I beleive that T4 is not installed for Express versions of Visual Studio 2008. Are both machines running the same edition?

Mel
A: 

I could not get it working in a regular Website project. When I added a Library project and moved my templates directory there, the generation started automatically and I also had the "Run Custom Tool" on my right-click. I think that's a neater separation anyway.

Richard