Hello! I'm trying to push my project template into (Visual C # / Web) (Just like the DevExpress Template Gallery in my screenshot there). I am trying to do this with the following lines of code in the file MyTemplate.vstemplate:

<TemplateData> <Name>My Template Gallery</Name> <Description>Start Template Gallery</Description> <Icon>myProj.ico</Icon> <ProjectType>CSharp</ProjectType> <ProjectSubType>Web</ProjectSubType> <TemplateGroupID>Web</TemplateGroupID> <RequiredFrameworkVersion>4.0</RequiredFrameworkVersion> <SortOrder>0</SortOrder> <NumberOfParentCategoriesToRollUp>0</NumberOfParentCategoriesToRollUp> <TemplateID>4d72892d-abc3-428d-8fa7-8421a83d6e0a</TemplateID> <CreateNewFolder>true</CreateNewFolder> <DefaultName>XafariApplication</DefaultName> <ProvideDefaultName>true</ProvideDefaultName> 

Screenshot

    1 answer 1

    Manual mode

    1. Create a project. Fill in the necessary initial files for the template. Save. enter image description here
      1. In the File menu, select Export Template. enter image description here
      2. In the Wizard, choose: Project Template. enter image description here
      3. Fill in the fields. enter image description here
      4. The archive will drop into the folder <Рабочая папка студии>\My Exported Templates and into the folder <Рабочая папка студии>\Templates\ProjectTemplates (if you have not unchecked the wizard): enter image description here
      5. This archive should be placed in the folder <Рабочая папка студии>\Templates\ProjectTemplates\Visual C#\Web (it does not exist, therefore you need to create it): enter image description here
      6. Come into the studio. And Profit. enter image description here

    Using VSIX

    1. You must be ready to archive. See points 1-5 of manual mode .
    2. Create a VSIX project.
    3. In the project, create the desired folder hierarchy. In this case, the following hierarchy is obtained: enter image description here
    4. Drop the archive into the ProjectTemplates\CSharp\Web folder.
    5. In the manifest you specify the necessary data. Then go to the item Assets and add: enter image description here
    6. Persist. Damn it. Run VSIX. Open a studio. enter image description here

    ProjectTemplate + VSIX

    1. Create a project of type ProjectTemplate fill it.
    2. Choose a file in the studio with the extension * .vstemplate (by default, its name is the same as the project name). And in its properties in the Category string you write the path of the hierarchy, which will start from CSharp. Those. if you specify SubA/SubB/SubC , then the template will be in CSharp/SubA/SubB/SubC . In our case, we specify only the Web : enter image description here
    3. Create a VSIX project.
    4. In the manifest, specify the necessary data: enter image description here
    5. Damn it.

    PS A little about the TemplateData element. You specified the ProjectSubType value to the Web , but this element can only have only 4 values:

    1. SmartDevice-NETCFv1 - indicates support for the .NET Compact Framework version 1.0
    2. SmartDevice-NETCFv1 - indicates support for the .NET Compact Framework version 2.0
    3. CSharp - Set only when the ProjectType element has a Web value (i.e., it is a web site type project). Indicates a programming language.
    4. VisualBasic is the same as the previous item, only the programming language VisualBasic .
    • @ V.Dmitriy, hello. In a zip file: build action is content. It is not necessary to copy to the output directory, since When building it, it will still pack in vsix. And with the Project Template, as there will be time, I will update the answer. - skubarenko
    • Hello @ nuts119! Thank you very much for the help! It does not work out for me to make a "VSIX method" which properties should be set to the archive and project containing it? - V. Dmitriy
    • @ V.Dmitriy, answered above. Laganulo with comments? Still now I will update about ProjectTemplate. - skubarenko
    • @ V.Dmitriy, updated the answer. - skubarenko
    • Yes, something lagano. Everything works, thanks @nuts119! - V. Dmitriy