Tuesday, March 20, 2007

* Accelerating development using Visual Studio Templates

Visual Studio templates are a very efficient way of accelerating development by providing a startup infrastructure for new project creation and new item creations during the project. An excellent example of this is the 'Console Application' project template available in the new project dialog box of Visual Studio.

When a new project is created using the 'Console Application' project template, all the mandatory & common things required by any console applications are created automatically and developer can directly jump to writing the code specific to his/her application. Two of the mandatory actions completed by the template are :

  • Setting the project output type as 'Console application'
  • Generating the skeleton code for 'main' class which is entry point for the application.

While Visual Studio comes with most commonly used project templates, custom project templates can also be developed.

There are basically two types of templates :

  • Project Templates : Available in the 'New Project' dialog box
  • Project Item Templates : Available in the 'Add New Item' dialog box in the solution explorer.

The main components of a template are :

  • The .vstemplate file which contains the metadata for the template like whether its a project template or a project item template.
  • The files which will be added to the project when the template is used like code, resource, etc files.

To read the detailed walkthrough on how to create a Project Template, pls go to following post.

I will cover the creation of project item template in my next post on this.

~tata & take care~

Other Posts

No comments:

Post a Comment