locked
Missing Files after using a Custom Project Template RRS feed

  • Question

  • Hi,

    I've tried to create a custom template for VisualStudio 2015 (Community Edition). The problem is that only the projects files and the def file is created in the new project, but the header files and the matlab files are missing.

    I proceeded as in (https)://msdn.microsoft.com/en-us/library/ms185319.aspx described but I have no idea what I am missing.

    I placed the complete template under (https)://rfu6255i4j05kgww.myfritz.net/owncloud/index.php/s/MEVueSXkcnAA5pA if somebody is interested.

    The content of Template file is:

    <VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">

      <TemplateData>

        <Name>SFunction</Name>

        <Description>&lt;No description available&gt;</Description>

        <ProjectType>VC</ProjectType>

        <ProjectSubType>

        </ProjectSubType>

        <SortOrder>1000</SortOrder>

        <CreateNewFolder>true</CreateNewFolder>

        <DefaultName>SFunction</DefaultName>

        <ProvideDefaultName>true</ProvideDefaultName>

        <LocationField>Enabled</LocationField>

        <EnableLocationBrowseButton>true</EnableLocationBrowseButton>

        <Icon>__TemplateIcon.ico</Icon>

      </TemplateData>

      <TemplateContent>

        <Project TargetFileName="SFunction.vcxproj" File="SFunction.vcxproj" ReplaceParameters="true">

          <ProjectItem ReplaceParameters="true" TargetFileName="$projectname$.vcxproj.filters">SFunction.vcxproj.filters</ProjectItem>

          <ProjectItem ReplaceParameters="true" TargetFileName="$projectname$.def">SFunction.def</ProjectItem>

          <ProjectItem ReplaceParameters="true" TargetFileName="$projectname$.h">SFunction.h</ProjectItem>

          <ProjectItem ReplaceParameters="true">InterfaceDefinition.h</ProjectItem>

          <ProjectItem ReplaceParameters="true">make.m</ProjectItem>

        </Project>

      </TemplateContent>

    </VSTemplate>



    Regards

    Sebastian


    • Moved by Jiayi Li Wednesday, August 19, 2015 5:10 AM
    Tuesday, August 18, 2015 12:33 PM

Answers

  • Hi,

    I found the bug on my own. It wasn't the template file but the vxprojects file. It seems that the paths in there are used to place the files in the target project.

    When I "exported" the template I used a non standard folder structure and the missing files were one level over the project files. So the entry in vxprojects was:

        <ClInclude Include="..\$safeprojectname$.h" />

    I guess this is not valid because after changing it to

        <ClInclude Include="$safeprojectname$.h" />

    everything works.

    Regards

    Sebastian

    • Marked as answer by Caillen Tuesday, September 1, 2015 8:13 AM
    Monday, August 24, 2015 12:31 PM

All replies

  • Hi SebWin123,

    This forum is about Visual Studio IDE, as your issue is about your custom templates, it would be related to Visual Studio Integrate, I help you move this case to Visual Studio Integrate forum for dedicated support.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    Wednesday, August 19, 2015 5:09 AM
  • Hi,

    I found the bug on my own. It wasn't the template file but the vxprojects file. It seems that the paths in there are used to place the files in the target project.

    When I "exported" the template I used a non standard folder structure and the missing files were one level over the project files. So the entry in vxprojects was:

        <ClInclude Include="..\$safeprojectname$.h" />

    I guess this is not valid because after changing it to

        <ClInclude Include="$safeprojectname$.h" />

    everything works.

    Regards

    Sebastian

    • Marked as answer by Caillen Tuesday, September 1, 2015 8:13 AM
    Monday, August 24, 2015 12:31 PM