VB.Net Code Generation

Dear Experts,

I have spent a few hours looking at the code generation capabilities of Visual Studio from a UML class diagram. I noticed that Visual Studio 2010 and 2012 have T4 templates only for C# and so the generated classes are in C#. My question is - Is there a way to generate VB.Net code from T4 templates? The most desirable solution for me will be a repository of VB.Net T4 templates or class, enum, struct etc. just as the ones defined for C#.

I have used tools like CodeSmith to generate C# code and so I am not looking for a code generator in general. My question is specifically for UML model to code generation in Visual Studio .Net.

Thanks for your help.
Who is Participating?
Kishan ZunjareConnect With a Mentor Sr. Software EngineerCommented:
By using T4 template we can generate code, it is same like C#.

You can look at bellow example - Creating reusable code generation templates

David L. HansenConnect With a Mentor Programmer AnalystCommented:
You could take the T4-generated C# code and just convert it here:

(there are several websites around that do the same thing).
shekhar_shashiAuthor Commented:
Thanks for the great suggestions. I was hoping for a resource that can supply the equivalent VB.Net templates but looks like the options are:
- Create VB.Net templates from ground up.
- Generate C# code from the existing C# templates and transform the code to VB.net using one of the code converters
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.