In my first blog on the Design Pattern Code Generator, I explained how to use the command line application to generate both a singleton class and the 5 or 6 provider model classes. I have extended this application to include Visual Studio 2008 item templates to automatically generate class files.
The Visual Studio Installation files are available on the Release page of the Codeplex project.
How-to use
0. Close all instances of Visual Studio.
1. Downlaod both the Singleton and Provider Model item template VSI files.
2. Double click on any of the downloaded .VSI files. Please don’t be alarmed by the blank Publisher information as I need to digitally sign these files. (Something for future releases).
3. Click the “Next” button. You will prompted with a “No Signature Found” window. Press “Yes”, or alternatively you can view the files by clicking “No” and clicking on the “View files in Windows Explorer…” link shown in Step 2.
4. Press on the “Finish” button to complete installation of the respective item template in Visual Studio and then press “Close” on the “Installation completed successfully” screen. Most of you should have no issues installing this, but if you do, please do not hesitate to provide feedback and issues on the “Issue Tracker” tab on the Codeplex project page.
5. Launch Visual Studio
6. Open any project (or create a new one).
7. Add a new item to your existing project. If you’re creating provider model classes, it’s recommended to create a new folder as that particular item template will generate more than one files.
8. On the “Add New Item” windows, in the “Categories” pane, go to “Visual C# Items” and then to “Code”.
9. Notice that there are two new item templates under the “My Templates” section.
10. Enter a class name and press the “Add” button.
11. Note that in both instances of the item template a to-do file will open with more instructions.
Downloads
This open-source project is available on Codeplex.
Future enhancements
The Visual Basic.NET item templates are on the way. Please stay tuned.
Notes
Visual Studio 2005 is not supported with the above item templates.

3 comments:
Hi Joubin,
Thx for these great templates.
However, when I try to add a new Provider file into my project I get the following error:
"Could not load file or assembly
Microsoft.VisualStudio.TemplateWizardInterface, Version=9.0.0.0 .....
The located assembly's manifest definition does not match the assembly reference"
Any idea ?
Thx again,
Shmulik
Hi Sam,
1. Are you using VS.NET 2008?
2. Do you have GAT/GAX installed? Which version?
3. Are you getting the problem with C# or Vb.NET?
I found a few links that may help you. Please try them out and let me know if any work:
http://forums.microsoft.com/msdn/showpost.aspx?postid=2120866&siteid=1
http://social.msdn.microsoft.com/forums/en-US/vsgatk/thread/f6464801-ad55-42db-be7f-d0eb5a8baa22/
http://www.codeplex.com/smartclient/Thread/View.aspx?ThreadId=14413
Cheers,
Joubin
p.s. thanks for trying out the item templates.
Thanks for this nice blog. I just love it.
Post a Comment