Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 616529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:20:12+00:00 2026-05-13T18:20:12+00:00

In Visual Studio 2005, 2008, and 2010, is it possible to define an Item

  • 0

In Visual Studio 2005, 2008, and 2010, is it possible to define an Item Template that only appears in the Add Item dialog for projects of a particular ProjectFlavor? I’d rather not clutter all of the other unrelated projects’ Add Items dialog if I can help it.

Seems that the <ProjectType>CSharp</ProjectType> is a fixed enumeration and I can’t find any place for a ProjectFlavor guid or otherwise.

I don’t see any examples of other products showing such restraint, but I want to make sure.

=====

OK, Aaron’s tip is very promising but my first attempt is unsuccessful.

In the .vstemplate:

<TemplateData>
    <Name>MyProject A File</Name>
    <Description>MyProject A File to do stuff</Description>
    <Icon>A.ico</Icon>
    <TemplateID>TemplateID_A</TemplateID>
    <TemplateGroupID>MyTemplateGroupID</TemplateGroupID>
    <ProjectType>CSharp</ProjectType>
    <RequiredFrameworkVersion>2.0</RequiredFrameworkVersion>
    <SortOrder>20</SortOrder>
    <NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
    <DefaultName>Template_A.cs</DefaultName>
    <ProvideDefaultName>true</ProvideDefaultName>
    <ShowByDefault>false</ShowByDefault>
</TemplateData>
<TemplateContent>
    <ProjectItem ReplaceParameters="true">Template_A.cs</ProjectItem>
</TemplateContent>

And on the package.cs:

// [ProvideProjectItem(typeof(MyProjectFactory), "MyTemplateGroupID", 
//    @"Templates\ProjectItems", 600)] // Took this out.

[ProvideProjectFactory(typeof(MyProjectFactory), 
    "My Project", "My Project Files (*.csproj);*.csproj", 
    null, null, @"Templates\Projects", 
    LanguageVsTemplate = "CSharp", 
    NewProjectRequireNewFolderVsTemplate = true, 
    TemplateGroupIDsVsTemplate="MyTemplateGroupID",
    TemplateIDsVsTemplate = "TemplateID_A,TemplateID_B")]
public sealed class MyPackage : Package { ... }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:20:12+00:00Added an answer on May 13, 2026 at 6:20 pm

    Yes this is possible and there are a few item templates “in the box” that do this. For example, you’ll notice that the C# or VB item templates for WPF items (Page, Window, FlowDocument, etc…) only appear if you’re working with a WPF-flavored project.

    The trick is to specify the same TemplateGroupID in each vstemplate file, and then specify this same TemplateGroupID in the registration of your project flavor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any portable version of Visual Studio (2005, 2008, 2010..)? Is it possible
Visual Studio (2005/2008/2010) appears to create a response file containing flags for the C/C++
On my Windows XP machine Visual Studio 2003 2005 and 2008 all complain that
Question: Assume a C++ hello world program, non .NET. With Visual Studio 2005/2008/2010, how
While developing and ASP.NET application in C# or VB using Visual Studio 2005/2008/2010 (Not
Does anyone know if Visual Studio 2005, 2008, or 2010 has an import suggestion
I know about this question: Which (third-party) debug visualizers for Visual Studio 2005/2008 do
Microsoft Visual Studio (2005 and 2008) seems to have fun shuffling the Project IDs
Whenever I install Visual Studio 2005 or 2008 and choose the C# profile, the
What are the benefits of upgrading from Visual Studio 2005 to 2008? Any thoughts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.