views:

146

answers:

3

I try to using the SQLite in SubSonic.Examples.ActiveRecord project so:

  1. Add a reference for System.Data.SQLite
  2. Copy the SQLite.ttinclude and Settings.ttinclude from \T4 Templates\TemplateProviders\ to the Models_Generated\
  3. Change the <#@ include file="SQLite.ttinclude" #> in the SQLite.ttinclude and Settings.ttinclude
  4. Change the settings: Namespace, ConnectionStringName, DatabaseName to "Blog" in the Settings.ttinclude file.

I meet two errors when regenerate the code: first one is because of missing a "break" at SQLite.ttinclude line #80

case "long":
case "integer":
    sysType= "long";
    break; // missing a break
case "guid":

After add a "break" the code file "Context.cs" can generate successfully, but the ActiveRecord.cs can not generate, there is a Warning:

Multiple template directives were found in the template. All but the first one will be ignored. Multiple parameters to the template directive should be specified within one template directive. D:\LP\Study\SubSonic 3 Final\Examples\SubSonic.Examples.ActiveRecord\Models_Generated\Settings.ttinclude 1 4

A: 

Since this appears to be a bug, you should submit an issue here: http://github.com/subsonic/SubSonic-3.0/issues

John Sheehan
+1  A: 

I download the latest version from SubSonic's github and everything is OK!

The new version a new T4 file: Structs.tt

Liu Peng
A: 

It's still a bug, no one has fixed this simple edit. I ran into this and fixed it myself.

P a u l