Solved

VB.Net Code Generation

Posted on 2014-03-09
3
591 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now