Tuesday, May 3, 2011

VSTemplate with build action

How do you create a VSTemplate so that it automatically sets the build action as "content" not the default which is "none"?

From stackoverflow
  • Have you tried setting the SubType attribute of the ProjectItem to Content?

  • that does not seem to have helped my template looks like this:

    <VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
          <TemplateData>
            <DefaultName>SparkFileName.Spark</DefaultName>
            <Name>Happy</Name>
            <Description>Spark file</Description>
            <ProjectType>VisualBasic</ProjectType>
            <SortOrder>10</SortOrder>
            <Icon>__TemplateIcon.ico</Icon>
          </TemplateData>
          <TemplateContent>
            <References>
    
            </References>
            <ProjectItem SubType="Content" TargetFileName="$fileinputname$.Spark"  ReplaceParameters="true">Spark.Spark</ProjectItem>
          </TemplateContent>
        </VSTemplate>
    
  • I am also interested in the solution.

  • it doesn't look like this can be done from the .vstemplate file, however it looks like you can user .pkgdef file to accomplish what you want.

0 comments:

Post a Comment