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:
|
Project
template descriptor file:
|
Projects based off the template:
|
|
Host Item Name
|
Main code file
|
|
Startup Class
|
|
PrimaryCookie
|
PrimaryCookie (MainCode.designer.xml file)
|
In VSTA v 1 the host does not need to be aware of any of
these.
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.
Workarounds:
1) Manually
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.
2) Manually
change the PrimaryCookie attribute in the xml designer file for the main code
file. To do this:
a. Create
the template with ProjectGen
b. Extract
the templates (both CSharp and VB).
c. Open
the xml designer file for the main code file (MainCode.designer.xml).
d. Update
the PrimaryCookie attribute of the HostItem element.
e. Save
the file.
f.
Zip the updated template (zip the items
individually- do not zip the folder which contains them).
g. Place
the template in the ProjectTemplateLocation if not already there.
h. Run
setup for the host.
Posted
Jun 12 2008, 11:48 AM
by
Melody