Solved

VB.Net Code Generation

Posted on 2014-03-09
3
607 Views
Last Modified: 2014-03-13
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.
0
Comment
Question by:shekhar_shashi
3 Comments
 
LVL 7

Accepted Solution

by:
Kishan Zunjare earned 250 total points
ID: 39916976
By using T4 template we can generate code, it is same like C#.

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

http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/
0
 
LVL 15

Assisted Solution

by:David L. Hansen
David L. Hansen earned 250 total points
ID: 39917653
You could take the T4-generated C# code and just convert it here:
converter.telerik.com

(there are several websites around that do the same thing).
0
 
LVL 3

Author Closing Comment

by:shekhar_shashi
ID: 39927064
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
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question