ObjectSharp Blogs

You are currently viewing

Bruce Johnson's SOA(P) Box

Using SOA in the .NET world


Adding a New Item Template to Visual Studio

Problem number two I ran into was how to include my newly minted item template into Visual Studio. There are two steps that need to be followed to accomplish this.

First, the appropriate ZIP file needs to be placed into the directory located (for me) at C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033\ItemTemplates. The ZIP file contains the .mht file that I had created, along with a .vstemplate file. The biggest problem I had with this seemingly simple process was how I created the ZIP file. I had a directory called ObjectSharpManualTest that contained the necessary files. I right-click on the directory and sent the directory to the Compressed File option. A nice zip file gets created and all is good with the world.

Except that it’s not in the correct format.

If you look at the ZIP file, the top level contains a Directory called ObjectSharpManualTest. The .mht and .vstemplate files are in that directory. But when Visual Studio loads the item templates, it only looks at the top level of the ZIP file. And, seeing no .vstemplate file, it moves on without loading. The solution is to select the .mht and .vstemplate files directly (i.e. not the directory in which they are loaded) before creating the compressed file. This results in a ZIP of the correct layout.

Once the ZIP file has been created, the following command (when executed from the Visual Studio 2005 Command Prompt) loads the item template into Visual Studio.

devenv /InstallVsTemplates

This command takes a few minutes to run, but when you’re finished the item template is ready to be used.

Comments

    No Comments

Leave a Comment

(required) 
(optional)
(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS