简体   繁体   中英

How to include templates into VSIX package

I am developing a package for VS2012 and what I have there is:

  • A custom project template and a set of custom item templates: Templates\\Items\\MyFirstItem (and more items there), Templates\\Projects\\MyProject

  • Each template item contains .vstemplate file which is set to VSTemplate build action.

  • A Package which registers a ProjectFactory in a way:

     [ProvideProjectFactory( typeof(MyProjectFactory), null, "My Project Files (*.myproj);*.myproj", "myproj", "myproj", @".\\\\NullPath", LanguageVsTemplate = "MyProject")] 
  • A "Create VSIX Container during the build" option is set for the project.

When I build the project I see that my templates are zipped correctly and are copied into the output folder as expected such as bin\\Debug\\ItemTemplates\\... and bin\\Debug\\ProjectTemplates . They are also installed properly into the experimental instance.

However, these templates are NOT getting included into .vsix file. And there is the question: how do I make them included without zipping them manually and including these zip files as assets into the source.extension.vsixmanifest?

You have to add those to the source.extension.vsixmanifest designer in your VSIX project. There is an Assets section and you basically just click New, select ItemTemplate from the type dropdown, select Current solution or project, then choose your item template. Repeat for every item template.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM