none
vstemplate文件中的ProjectType与ProjectSubType如何自定义? RRS feed

  • 问题

  • 目前在研究SDK中的项目模板,遇到一下模板分类的问题,经过查询资料得知,是通过vstemplate文件中的ProjectType与ProjectSubType定义的,所以在此特请教一下,这两个节点如何根据需要自定义?麻烦知道的告知一下,感激不尽!
    2014年9月8日 4:58

答案

  • <VSTemplate Version="3.0.0" Type="Project" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
      <TemplateData>
        <Name>BusinessLogic</Name>
        <Description>BusinessLogic Library</Description>
        <Icon Package="{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}" ID="4547" />
    <ProjectType>CSharp</ProjectType>
        <SortOrder>20</SortOrder>
        <CreateNewFolder>false</CreateNewFolder>
        <DefaultName>BusinessLogic</DefaultName>
        <ProvideDefaultName>true</ProvideDefaultName>
      </TemplateData>
      <TemplateContent>
        <Project File="BusinessLogic.csproj" ReplaceParameters="true">
          <ProjectItem ReplaceParameters="true">Properties\AssemblyInfo.cs</ProjectItem>
        </Project>
      </TemplateContent>
      <WizardExtension>
        <Assembly>Microsoft.Practices.RecipeFramework.VisualStudio, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</Assembly>
        <FullClassName>Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate</FullClassName>
      </WizardExtension>
      <WizardData>
        <Template xmlns="http://schemas.microsoft.com/pag/gax-template" SchemaVersion="1.0">
        </Template>
      </WizardData>
    </VSTemplate>

    ProjectSubType 我没用到过。

       

    做一名合格的中国人!

    2014年9月8日 11:59
  • 你好,

    <sentencetext xmlns="http://www.w3.org/1999/xhtml"></sentencetext>

    首先谢谢中尉的积极参与!

    <sentencetext xmlns="http://www.w3.org/1999/xhtml">ProjectSubType : 将模板归入 ProjectType 元素中指定的值的子类别。</sentencetext>          

    下面这两个MSDN 文档应该能帮助你:

    http://msdn.microsoft.com/zh-CN/library/ms171386.aspx

    http://msdn.microsoft.com/zh-CN/library/vstudio/ms185312(v=vs.100).aspx


    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. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    2014年9月9日 9:23
    版主

全部回复

  • <VSTemplate Version="3.0.0" Type="Project" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
      <TemplateData>
        <Name>BusinessLogic</Name>
        <Description>BusinessLogic Library</Description>
        <Icon Package="{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}" ID="4547" />
    <ProjectType>CSharp</ProjectType>
        <SortOrder>20</SortOrder>
        <CreateNewFolder>false</CreateNewFolder>
        <DefaultName>BusinessLogic</DefaultName>
        <ProvideDefaultName>true</ProvideDefaultName>
      </TemplateData>
      <TemplateContent>
        <Project File="BusinessLogic.csproj" ReplaceParameters="true">
          <ProjectItem ReplaceParameters="true">Properties\AssemblyInfo.cs</ProjectItem>
        </Project>
      </TemplateContent>
      <WizardExtension>
        <Assembly>Microsoft.Practices.RecipeFramework.VisualStudio, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</Assembly>
        <FullClassName>Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate</FullClassName>
      </WizardExtension>
      <WizardData>
        <Template xmlns="http://schemas.microsoft.com/pag/gax-template" SchemaVersion="1.0">
        </Template>
      </WizardData>
    </VSTemplate>

    ProjectSubType 我没用到过。

       

    做一名合格的中国人!

    2014年9月8日 11:59
  • 你好,

    <sentencetext xmlns="http://www.w3.org/1999/xhtml"></sentencetext>

    首先谢谢中尉的积极参与!

    <sentencetext xmlns="http://www.w3.org/1999/xhtml">ProjectSubType : 将模板归入 ProjectType 元素中指定的值的子类别。</sentencetext>          

    下面这两个MSDN 文档应该能帮助你:

    http://msdn.microsoft.com/zh-CN/library/ms171386.aspx

    http://msdn.microsoft.com/zh-CN/library/vstudio/ms185312(v=vs.100).aspx


    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. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    2014年9月9日 9:23
    版主