T4 Template issue in web application (VB) (Subsonic)

subsonicsubsonic3

Hey there, new to SubSonic and Templates.

I'm compiling my Web Application using VB.net (I didn't notice anywhere that SubSonic requires C#.net and although I can write c# code I am more versed in VB.NET) and I'm having an issue with the ActiveRecord.tt file.

I took the files from the 3.0 download from the "SubSonic_3_0_0_3\SubSonic 3 Final\T4 Templates\SubSonic.TemplatesVB\ActiveRecord" folder. (Obviously I only took the .tt files).

I replaced the required file with the MySQL tt and changed the include file references to match also.

When I try to run the tt's it does not complie the ActiveRecord.tt at all.
It points to the "col.CleanName += ColumnSuffix;" line.
Doing a search the ColumnSuffix is not mentioned anywhere in the file.

if (tbl.ClassName == col.CleanName)
{
    col.CleanName += ColumnSuffix;
}

Also, in addition, the other compiled VB files although they read the database etc, the reference come back as undefined.

"Type 'productzone_content_page' is not defined." "productzone_content_page" being the name of the table.

Any ideas where I went wrong?


Also, I came to start using SubSonic from develing into dashCommerce (or what was).
I find it very very useful and handy. Keep up the great work.

Best Answer

I was using the VB templates, but the C# counterpart is better. I put the templates in a separate project, and added that project in the references of my VB main project. It work for me.