1

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.

CJM
  • 11,908
  • 20
  • 77
  • 115
  • 1
    Another alternative could be to separate your DAL out into its own Project, and reference that in your website project. – kevinw Aug 03 '09 at 11:26
  • I'd actually planned this originally - can't remember why I changed. Tried this yesterday; the text templates are processed in my Class Library DAL project - unfortunately, processed with errors. I'm investigating and will post more when I can. – CJM Aug 04 '09 at 10:10

2 Answers2

1

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

Adam Cooper
  • 8,077
  • 2
  • 33
  • 51
  • I'd come across that suggestion, but my context-sensitive menus don't have that option. – CJM Aug 03 '09 at 09:26
  • ... of course, Web Applications do have that option - see my conclusions above. Thanks for your suggestion anyway. – CJM Aug 03 '09 at 10:21
0

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!

CJM
  • 11,908
  • 20
  • 77
  • 115