March 25, 2019
Hot Topics:

Create Your Own Project Item Templates in VS 2005

  • April 15, 2005
  • By Paul Kimmel
  • Send Email »
  • More Articles »

Use the Project Item Template

To use the template, add the .vstemplate file and the code file to a zip file. (Windows XP supports zip files, or you can use WinZip). Place the zipped file in \My Documents\Visual Studio\ItemTemplates\Visual Basic. Restart Visual Studio 2005 and you will see a section in the Add New Item dialog under My Templates name Typed Collection (see Figure 1). Select this item to add a typed collection to any project.

Click here for a larger image.

Figure 1: The Typed Collection Project Item Template in Visual Studio 2005

A good technique is to build your template code and test it first. Once you remove any syntax errors or bugs, replace the literal values with template tokens and complete the process of moving the template files to the My Documents folder.

After you have created the template, use it to add an item to a test project.

Create Templates to Jumpstart Development

To create a project item template, create the stubbed source file and an XML file with a .vstemplate extension. The XML file describes your template to the IDE. Place all of the code files and the .vstemplate file in a zipped file and move it to the \My Documents\Visual Studio\ItemTemplates\Visual Basic\ folder, and it is ready to use.

Creating templates can help jumpstart application development and make it much easier to use even the most advanced features of Visual Studio and Visual Basic. In 2005, this process is even easier.

About the Author

Paul Kimmel is the VB Today columnist for www.codeguru.com and has written several books on object-oriented programming and .NET. Check out his book Visual Basic .NET Power Coding from Addison-Wesley and his upcoming book UML DeMystified from McGraw-Hill/Osborne (Spring 2005). Paul is also the founder and chief architect for Software Conceptions, Inc, founded 1990. He is available to help design and build software worldwide. You may contact him for consulting opportunities or technology questions at pkimmel@softconcepts.com.

If you are interested in joining, sponsoring a meeting, or posting a job, check out www.glugnet.org, the Web page of the Greater Lansing area Users Group for .NET.

Copyright © 2005 by Paul T. Kimmel. All Rights Reserved.

Page 2 of 2

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date