解决方案文件夹无法在VSTemplate ProjectCollection中创建

时间:2016-05-12 08:00:12

标签: c# visual-studio-templates

我使用以下代码生成新模板。问题是它没有创建解决方案文件夹并在其中添加项目。

DIR_DLIB = "$${LIBSDIR}dlib/dlib18.18/"
DEFINES += DLIB_ENABLE_ASSERTS
LIBS += -luser32 -lws2_32 -lgdi32 -lcomctl32 -limm32 -lwinmm
INCLUDEPATH += "$${DIR_DLIB}include"
DEPENDPATH += "$${DIR_DLIB}include"
LIBS += -L"$${DIR_DLIB}lib"
LIBS += -ldlib

因此,当使用模板创建新项目时,不会像提到的那样创建解决方案文件夹<VSTemplate Version="3.0.0" Type="ProjectGroup" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"> <TemplateData> <Name>DDD Framework</Name> <Description>Domain Driven Design</Description> <ProjectType>CSharp</ProjectType> <ProjectSubType> </ProjectSubType> <SortOrder>1000</SortOrder> <CreateNewFolder>true</CreateNewFolder> <DefaultName>DDD_Framework</DefaultName> <ProvideDefaultName>true</ProvideDefaultName> <LocationField>Enabled</LocationField> <EnableLocationBrowseButton>true</EnableLocationBrowseButton> <Icon>Logo.png</Icon> </TemplateData> <TemplateContent> <ProjectCollection> <SolutionFolder Name="01 Core"> <ProjectTemplateLink ProjectName="$projectname$.Data"> Data\MyTemplate.vstemplate </ProjectTemplateLink> <ProjectTemplateLink ProjectName="$projectname$.Objects"> Objects\MyTemplate.vstemplate </ProjectTemplateLink> </SolutionFolder> </ProjectCollection> 01 Core

1 个答案:

答案 0 :(得分:0)

经过一些分析并添加此标记<CreateInPlace>true</CreateInPlace>解决方案文件夹正在创建,它终于有效了!!!

<VSTemplate Version="3.0.0" Type="ProjectGroup" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
    <TemplateData>
         <CreateInPlace>true</CreateInPlace>
    </TemplateData>
</VSTemplate>