开发者

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

开发者 https://www.devze.com 2022-12-16 07:11 出处:网络
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

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 altho开发者_运维技巧ugh 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.


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.


After searching the corresponding code in the C# template, I altered the VB code to match:

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

It compiles cleanly now.

0

精彩评论

暂无评论...
验证码 换一张
取 消