Solved

VB.Net Code Generation

Posted on 2014-03-09
3
634 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

622 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