On the third screen of ProjectGen there is an item to fill
in titled “Host item name”. This item is
used in two places in the project descriptor file and three places in projects
based off the template:
template descriptor file:
Projects based off the template:
Host Item Name
Main code file
PrimaryCookie (MainCode.designer.xml file)
In VSTA v 1 the host does not need to be aware of any of
In VSTA v 2, the startup class is used when loading add-ins
and the PrimaryCookie is used in DPM scenarios.
ProjectGen offers the option of using a project descriptor
file as input instead of manually entering all of the information. This is where the Gotcha comes in. If you use a project template descriptor file
as input for ProjecGen and change the host item name on the third screen, in
the new project template descriptor file and the resulting template only the
host item name will be updated. The
PrimaryCookie will remain unchanged.
change the PrimaryCookie in the project template descriptor file before use as
input for ProjectGen. Then use the
descriptor file as input- no additional steps are required.
change the PrimaryCookie attribute in the xml designer file for the main code
file. To do this:
the template with ProjectGen
the templates (both CSharp and VB).
the xml designer file for the main code file (MainCode.designer.xml).
the PrimaryCookie attribute of the HostItem element.
Zip the updated template (zip the items
individually- do not zip the folder which contains them).
the template in the ProjectTemplateLocation if not already there.
setup for the host.
Jun 12 2008, 11:48 AM