by Bruce Johnson via Bruce Johnson's SOA(P) Box on 9/19/2006 3:56:00 PM
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.
Original Post: Adding a New Item Template to Visual Studio
The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.