Question

I'm trying to start using Subsonic (v3). The brief installation instructions indicate that I must:

  • add a reference to the DLL = Done
  • edit Setting.ttinclude to use right connection string = Done; added appsettings to web.config
  • add templates to project = Done, but nothing is generated; no errors and no code.

The demo indicates that when you add the files, either appropriate .vb/.cs classes are created, or it generates some errors - but I get nothing, simply a folder with the templates in.

I'm a complete novice when it comes to T4 templates - in fact, I never knew they existed until now(!).

Any thoughts? This must be something fundamental; this is supposed to be so simple.

FYI: I'm using VS Professional 2008 - I understand there can be similar issues with VS Express.

Was it helpful?

Solution 2

Conclusion: It appears that the code generation works for me in a C# Console Application project, in a VB Windows Forms project and even in a C# Web Application... but not in a Website project!

Seeing as there is now a second benefit for me to Web Applications (alongside XML Documentation), I'll convert (or recreate) the project. For similar, small projects like this, I usually preferred to use Websites, but I'm happy to make the conversion.

Apparently, I could add a context menu (to use the TextTransform.exe command-line tool) for use in Website projects, but a) it didn't work on first attempt, and b) it seemed akin to going about things the hard way!

OTHER TIPS

Right click the .tt files and choose 'Run Custom Tool' and your code should be generated.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top