Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
362 views
in Technique[技术] by (71.8m points)

c++ - Exported project template in VS2017 misses source files

When I use the Project -> Export template option in Visual Studio 2017, the resulting ZIP file includes the main project files, but not any of the *.cpp and *.hpp files that I've added. How do I include everything with the template? I should also note that this behavior seems to have changed in an update at some point.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to manually edit the .vstemplate file and add <CreateInPlace>true</CreateInPlace> in the <TemplateData> tag so it looks like this:

<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">
    <TemplateData>
        <Name>TemplateTest</Name>
        <Description><No description available></Description>
        <ProjectType>JavaScript</ProjectType>
        <ProjectSubType>
        </ProjectSubType>
        <SortOrder>1000</SortOrder>
        <CreateNewFolder>true</CreateNewFolder>
        <CreateInPlace>true</CreateInPlace>
        <DefaultName>CodovaTemplateTest</DefaultName>
        <ProvideDefaultName>true</ProvideDefaultName>
        <LocationField>Enabled</LocationField>
        <EnableLocationBrowseButton>true</EnableLocationBrowseButton>
        <Icon>__TemplateIcon.ico</Icon>
  </TemplateData>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...