The Best Damn Visual Studio Add-In Ever

What Gives? Microsofts Code Generation Tool

17. November 2008 19:48 by Scott in   //  Tags: , , , , ,   //   Comments (31)

In a world of Microsoft and third party applications, out comes t4.  t4 is a code generation tool that can compete with CodeSmith, but its FREE and built right into Visual Studio. It has been years since the first edition with very little publication of the actual application. t4 is a free code generation engine from Microsoft that underpins the Domain Specific Languages and Software Factory toolkits.  t4 is a rich code generation and has the ability to stand up against and compete with CodeSmith.  I have used both Codesmith and MyGeneration a lot in the past few years, so I have seen the competition.  What is nice about this old/non publicized tool is that it is built directly into Visual Studio 2008.

t4 is being spear headed into the open source market for free templates by Oleg Sych.  It brings a long a toolbox which can also be download with extra templates along with a GREAT T4 Editor which of course is also free.  There is not more need to spend money on CodeSmith, when Microsoft will do it right out of the box with Visual Studio.

Some have speculated, why hasn't Microsoft published this tool to a greater extent.  We can only think that it has to do with being a Gold Partner.  Microsoft doesn't like to lose Gold Partners and therefore hasn't truly publicized this tool.  The next question you have to ask your self is what can be generated?

  • Site Maps.
  • Database schemas.
  • Session Variables. 
  • Store Procedures.
  • Text Documents.

As of October 2008, t4 Editor has been officially placed as a plug in to Visual Studio 2010, which will boost the ability to generate t4 code through other means besides CodeSmith.

Demos and Other information can be found below.

Point of concern: If your company currently uses CodeSmith, wouldn't it be nice to tell your boss what you found could save the company a few hundred dollars by using something that is already built into Visual Studio? So why not give it a try and save a little money doing it?

kick it on DotNetKicks.com

If you liked this post, please be sure to subscribe to my RSS Feed.

Comments (31) -

Vijay Santhanam
Vijay Santhanam
11/19/2008 2:18:20 AM #

Nice. never heard of t4 before. Looks better than codesmith for real real.

Will t4 move into the framework itself?

Scott
Scott
11/19/2008 6:46:18 AM #

t4 will not be a part of the framework, but a plug-in to Visual Studio it self.  The ability to generate t4 code is not part of .Net.

Alexey Romanov
Alexey Romanov
11/19/2008 9:05:36 AM #

Actually, t4 is already available in Visual Studio 2008, no need for any plug-ins. T4 Editor, which you linked to, is a plug-in which gives you syntax highlighting, autocompletion, etc. when editing the files, but to generate code you just:
1) Add a .tt file to the project;
2) Right-click on it;
3) Choose "Run Custom Tool".

Mike Griffin
Mike Griffin
11/19/2008 10:38:31 AM #

Mike Griffin of MyGeneration and EntitySpaces here. Our EntitySpaces 2009 alpha comes out this weekend, full blown code generation right inside of Visual Studio, it's pretty cool. Here's some info on it ...

www.entityspaces.net/.../...009+Video+Preview.aspx

Part 1
www.entityspaces.net/.../...der+Visual+Studio.aspx

Part 2
www.entityspaces.net/.../...ual+Studio+Part+2.aspx

Mike Griffin
Mike Griffin
11/19/2008 11:35:19 AM #

I wonder if Microsoft is working some kind of deal with CodeSmith? CodeSmith was always the "blessed" code generation while MyGeneration was the Rodney Dangerfield of code generators, no respect, no contests won, no nothing, I'm not bitter, I swear ;) lol

Anyway, I'm suprised I haven't seen any kind of really cool roadmap come out of CodeSmith, a VS shell full blown app, something? Maybe the silence means some kind of deal between CodeSmith and Microsoft, but then there is some kind of relationship between Telligent and CodeSmith so who knows. Anyway, posts like yours can't make CodeSmith happy. I would like to say Eric Smith of CodeSmith has been very good to us at EntitySpaces, carrying out blog posts about EntitySpaces supporting CodeSmith and such, so he's a good guy.

There's plenty of room folks, just like the ADO EF wont kill EntitySpaces T4 is not the end all of code generators ....

Bill Booth
Bill Booth
11/19/2008 7:40:59 PM #

It would be nice to mention that not all versions of the Editor are free.

Bill Booth
Bill Booth
11/19/2008 7:43:00 PM #

It would be nice to mention that not all versions of the Editor are free.

cowgaR
cowgaR
11/20/2008 2:49:05 AM #

btw, subsonic 3.0 uses T4 extensivelly as well, and it is turning up to be one really nice data acees/code generator tool, although not as much of an OR/M like Entity Spaces right now... but things can change Wink

ES is a _very_ nice framework though (from what I see), looking forward to 2009 version...
For now I like things as easy and as simple as possible (not to say ES is complicated), and subsonic is aiming exactly that way. If (for me) it would not be sufficient, I would probably switch to ES if (at that time) Mike won't drive ES towards NHibernate/LLBLGen way - e.g. rich frameworks that even can make caffee for you and do some ironing as well.

back to the point, T4 should become more popular and see big improvements in VS2010 so we don't need to pay (again) for external editors like clarius's one...

robert
robert
11/24/2008 8:56:44 AM #

As someone who has used both extensively, I would say t4 is still a long way away from CodeSmith in terms of sheer ability.  CodeSmith Projects can generate n number of other projects and n number of files and automagically include it in your project file.  T4 is good for the one off code gen file, as you mentioned recipes and things like that.  No question when it's free sometimes that's enough.  But anyone actually writing a DSL and has tried both will immediately know which is easier to use and get out the door with.

Other things like the SchemaExplorer meta data api, and ActiveSnippets which are like VS snippets on steroids which can accept parameters like database tables and xml files and run a template inline your code.  I think the problem with CodeSmith is that the folks just don't know how to use these advanced features.

sidney
sidney
11/13/2011 9:10:38 PM #

Great article, exactly what I was looking for.

acne cure
acne cure
6/6/2013 9:33:49 PM #

If no more drugs please? Is the person loose teeth and this article to use ornate bobbles and tassels as well as acne killer and even. The treatment method of becoming cancerous. All right, thanks a lot of water it helps kill the Acne Killer. Sometimes staring into a melanoma you want to play with. Talking about different lust worthy features, it is imperative that you want.

Here is my web-site ::  acne cure - http://more4you.ws/articles/submit.php

video game jobs
video game jobs
6/18/2013 12:07:23 PM #

An interesting discussion is worth comment. I believe that you ought to write more on this topic, it may not be a taboo subject but usually people don't speak about these topics. To the next! Cheers!!

Have a look at my weblog ...  video game jobs - http://www.youtube.com/watch?v=QoSh_gN2PuQ

weight loss
weight loss
6/20/2013 8:49:12 PM #

You should take part in a contest for one of the best blogs on the internet. I most certainly will highly recommend this blog!

Here is my site  weight loss - http://www.youtube.com/watch?v=ywlyUrjNOc4

faxless payday loans
faxless payday loans
6/23/2013 12:09:46 AM #

If some one needs to be updated with most recent technologies therefore he must be pay a quick visit this web page and be up to date every day.

my site ::  faxless payday loans - http://www.youtube.com/watch?v=0x-dzi7ABhs

woodworking plans and projects
woodworking plans and projects
6/29/2013 1:39:32 PM #

It's amazing to go to see this web page and reading the views of all friends regarding this paragraph, while I am also zealous of getting know-how.

Also visit my web-site  woodworking plans and projects - http://woodworkingplanswood.us

voyance gratuite
voyance gratuite
6/29/2013 4:16:41 PM #

Voyance gratuite - http://www.mavoyancegratuite.biz  par internet fuck  astrologie personnalite

webpage
webpage
7/10/2013 1:54:32 PM #

If someone not in a position to face financial emergencies, then often it will arise in your life and make yourself disturb. FHA loans, however, are government-backed securities. Cash advance loans are a specific type of loans that are designed in such a way that they give the borrower fast access to much needed money.

Here is my site -  webpage - http://www.snyderslance.com/member/137711

website
website
7/11/2013 5:22:03 PM #

People intending to tap equity from their homes to pay for renovations or debt consolidation usually spend a lot of time trying to find the best fixed home equity loan rate that they can get. Beside this if someone is tagged with some poor credit factor and not able to avail the financial help from anywhere then this instant approval payday loans comes out to be beneficiary help for them. To instant payday loans you have to submit few documents such as:-.

Here is my webpage ::  website - http://www.yogiproducts.com/member/501003/

tarot gratuit
tarot gratuit
7/15/2013 5:06:49 AM #

Horoscope du taureau femme oral  didier colin horoscope

Review my blog  tarot gratuit - http://www.bartlatjes.com

tirage tarot gratuit
tirage tarot gratuit
7/16/2013 1:46:42 AM #

Horoscope.fr demain cum  horoscope lion hebdomadaire

Here is my web page -  tirage tarot gratuit - http://www.urocomp.org

turbine a glace
turbine a glace
7/28/2013 3:03:22 PM #

Hey! This post couldn't be written any better! Reading this post reminds me of my previous room mate! He always kept chatting about this. I will forward this article to him. Fairly certain he will have a good read. Many thanks for sharing!

Check out my homepage -  turbine a glace - http://www.turbineaglace.info/

voyance en direct
voyance en direct
8/5/2013 4:08:52 PM #

Signe astrologique balance femme jeff voyance gratuite

Review my website  voyance en direct - http://www.voyantpartelephone.org

tarot de marseille gratuit
tarot de marseille gratuit
8/9/2013 12:10:35 PM #

Prevision astrologiques 2012 avenir par les cartes gratuit

Look at my weblog;  tarot de marseille gratuit - http://www.voyancedutarot.net

Rosario
Rosario
8/9/2013 1:23:36 PM #

Nice post. I learn something new and challenging on blogs I stumbleupon everyday. It's always helpful to read content from other authors and practice something from their sites.

Here is my page :: commode à langer ( Rosario - http://www.commodealanger.org/ )

aimbotwarfare.com
aimbotwarfare.com
8/15/2013 10:00:49 AM #

Brewing which optimal cup of coffee in your very own home drip coffee maker is not which difficult, given your have the great stuff, the appropriate liquid, proper filter, and also a high quality freshly roasted coffee. After living in Spain I got at drinking coffee making use of a great kitchen stove espresso maker because these was almost all anyone ever familiar with render coffee so after we came home in order to the UK we bought me definitely one.

Here is my web site: depression ::  aimbotwarfare.com - aimbotwarfare.com/modules.php  ::

voyant
voyant
8/16/2013 7:28:27 PM #

30 octobre signe astrologique tirage en croix gratuit

Look into my website  voyant - http://www.agiftforthefuture.org

voyant gratuit
voyant gratuit
8/17/2013 12:05:08 AM #

Savoir signe astrologique horoscope 2012 christine haas

Also visit my webpage -  voyant gratuit - http://www.monvoyant.org

medium gratuit
medium gratuit
8/18/2013 11:50:46 PM #

Divinatoire manu voyance

Have a look at my homepage:  medium gratuit - http://www.moeys-elibrary.org

voyance discount
voyance discount
8/22/2013 3:34:09 PM #

Tirage du tarot divinatoire gratuit compatibilite signe astrologique gratuit

my weblog:  voyance discount - http://www.natashasfoodforpaws.com

voyance en ligne
voyance en ligne
8/23/2013 5:20:15 AM #

Tarot express horoscope personnalise du jour

Visit my homepage;  voyance en ligne - http://www.foryou-wasserbett.com

film porno gratuit
film porno gratuit
8/23/2013 9:54:24 PM #

Sexe dans film porn videos n

my blog post -  film porno gratuit - http://www.filmpornoxgratuit.com