Adding a Hidden File to a Project Template


In many situations you want to add background code to a VSTA project template without exposing it to the user.  An easy way to do this is to add a hidden code file to the template.  Here are the 6 steps to do this which are the same for both C# and VB templates:

1)    Unzip the existing project template.
2)    Add the file to use as the hidden code file to the same folder as all other files in the template (do not put it in a sub folder).
3)    Update the vstemplate file to include the hidden file.  Use the same syntax as the main code file.
4)    Update the xxproj file to include the hidden file.  Use similar syntax as the hidden xml designer file.
5)    Save and re-zip the updated template, moving the new zip file to the ProjectTemplatesLocation.
6)    Run vsta setup for the host.

 

Related blog with samples


Posted Jan 23 2009, 04:05 PM by Melody
Copyright Summit Software Company, 2008. All rights reserved.