VS2010: VSIX installation doesn't deploy item templates inside it
Asked Answered
T

2

1

Given demo solution with two VSX-projects: 1. Add New Project -> Extensibility -> Item Template - "ItemTemplate1" 2. Add New Project -> Extensibility -> VSIX Project - "VSIXProject1"

I did no changes in "ItemTemplate1", so it constains default item template (ItemTemplate1.vstemplate):

<VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
  <Name>ItemTemplate1</Name>
  <Description>&lt;No description available&gt;</Description>
  <Icon>ItemTemplate1.ico</Icon>
  <TemplateID>e298765c-97b8-4f4c-9b7b-a6b368f914df</TemplateID>
  <ProjectType>CSharp</ProjectType>
  <RequiredFrameworkVersion>2.0</RequiredFrameworkVersion>
  <NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
  <DefaultName>Class.cs</DefaultName>
</TemplateData>
<TemplateContent>
    <References>
        <Reference>
            <Assembly>System</Assembly>
        </Reference>
    </References>
  <ProjectItem ReplaceParameters="true">Class.cs</ProjectItem>
</TemplateContent>
</VSTemplate>

In VSIXProject1 I only edited source.extension.vsixmanifest adding reference to ItemTemplates1 project. After this vsixmanifest contains only one content description:

<Content>
    <ItemTemplate>ItemTemplates</ItemTemplate>
</Content>

Then built it. In bin/debug I got VSIXProject1.vsix inside which I can see my item template in ItemTemplates\CSharp\1033\ItemTemplate1.zip file.

Everything looks great!

Except the fact it doesn't work. I run VSIXProject1.vsix, vsix installed (I can see it in the extension manager) but no any templates was copied to "C:\Users\{UserName}\Documents\Visual Studio 2010\Templates\ItemTemplates" !

Tham answered 1/9, 2010 at 16:29 Comment(0)
W
5

Templates that are installed through a VSIX don't get installed to the Templates folder in the user Documents folder. They get installed under %LocalAppData%\Microsoft\VisualStudio\10.0\Extensions\<YourExtensionFolder> with all the other content for that extension. (A VSIX install is basically just unzipping the VSIX to a folder.)

You should still be able to see the template when you try to add a new item to a C# project.

Wengert answered 1/9, 2010 at 22:26 Comment(1)
Thank you, Aaron. You're right indeed, I just found one my (probably old) template in User's Documents folder and decided it's the right place. Moreover VS2010 does search templates in the User's Documents folder and unlike LocalAppData's place does this without a need of restarting. That fact put me out. (As I installed a vsix, see no template then copy them to User's Documents and do see template)Tham
W
1

please check the website below.It has help to solve my issue. http://silverlightdude.wordpress.com/2010/06/07/installing-the-prism-template-pack-for-visual-studio-2010/#comment-4

Wholesale answered 22/4, 2011 at 2:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.