locked
How to change name of zip file that contains the VS template in vsix package? RRS feed

  • Question

  • Hi all,

    I follow this walkthrough Creating Visual Studio Extension (VSIX ) in order to put my Visual Studio project template to vsix package. One problem I run into so far is that the created zip file that contains the template has the same name as file with vstemplate extension. I couldn't find the way how/where I state another name of created zip file that is a part of vsix file. For example I have MyVisualStudioTemplateWithALongName.vstemplate and finally I'll have  MyVisualStudioTemplateWithALongName.zip in vsix package but I wish to have zip file with another name. How can I do it?


    Dmitry

    Lightning Tools LogoLightning Tools Check out our SharePoint tools and web parts
    Monday, January 16, 2012 11:10 AM

Answers

  • Setting the TargetPath metadata on the project item or project reference to the name of the zip file will cause the resulting zip file in the VSIX package to have the specified name. See example below:

      <ItemGroup>     <ProjectReference Include="..\ItemTemplate1\ItemTemplate1.csproj">       <Project>{8BF4A54F-FEA6-43EC-9706-8A9EE68C447D}</Project>       <Name>ItemTemplate1</Name>       <IncludeOutputGroupsInVSIX>TemplateProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>       <TemplateType>Item</TemplateType>       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>       <VSIXSubPath>ItemTemplates</VSIXSubPath>       <TargetPath>ShortTemplateName.zip</TargetPath>     </ProjectReference>   </ItemGroup>

    -Lance

     

    Monday, January 16, 2012 6:12 PM

All replies

  • Setting the TargetPath metadata on the project item or project reference to the name of the zip file will cause the resulting zip file in the VSIX package to have the specified name. See example below:

      <ItemGroup>     <ProjectReference Include="..\ItemTemplate1\ItemTemplate1.csproj">       <Project>{8BF4A54F-FEA6-43EC-9706-8A9EE68C447D}</Project>       <Name>ItemTemplate1</Name>       <IncludeOutputGroupsInVSIX>TemplateProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>       <TemplateType>Item</TemplateType>       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>       <VSIXSubPath>ItemTemplates</VSIXSubPath>       <TargetPath>ShortTemplateName.zip</TargetPath>     </ProjectReference>   </ItemGroup>

    -Lance

     

    Monday, January 16, 2012 6:12 PM
  • Hi Lance,

    Works like a charm. Thanks a lot!


    Dmitry

    Lightning Tools LogoLightning Tools Check out our SharePoint tools and web parts
    Monday, January 16, 2012 8:18 PM