I am nearing my breaking point with trying to figure out all of the intricate details of creating a custom project system in Visual Studio, hence my post.
I have successfully created a Visual Studio package that defines two different project types, and associated project factories, templates, etc. When I go to add a new project in VS, I see my two projects and can create them as expected.
I also have a couple of custom item templates that should only be able to be added to projects of one of my defined project types. Adding a new item works as expected (and their custom editors work as well), but.......
After I create one of my new custom projects in VS, I right click on the root project node in the Solution Explorer and select "Add New Item". This displays the "Add New Item" dialog, filtered to show only items that match my project type. Great!
When the "Add New Item" dialog is displayed, each item has its expected icon that I have defined in each respective .vstemplate file (loaded from the VsPackage.resx in my package). Great!
However, when I add the item to my custom project, the item's icon is displayed as an "empty file" icon, and not the one that is displayed in the "Add New Item" dialog.
And THIS is what is driving me crazy at the moment. How can I customize the icon that is displayed for custom items added to my project?
Here is a sample of my item template (.vstemplate):
<?xml version="1.0" encoding="utf-8"?><VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"><TemplateData><Name>Item Name</Name><Description>Item Name Description</Description><Icon Package="{77AA2C60-38C9-45A8-88CB-396FDC6D063A}" ID="5000" /><TemplateGroupID>MyProject.ItemTemplates</TemplateGroupID><ProjectType>MyProject</ProjectType><RequiredFrameworkVersion>2.0</RequiredFrameworkVersion><NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp><DefaultName>CustomFile.custom</DefaultName></TemplateData><TemplateContent><ProjectItem ReplaceParameters="true">CustomFile.custom</ProjectItem></TemplateContent></VSTemplate>Note that I am using an icon from my VS package's embedded resources.
How can I get the same icon shown in the "Add New Item" dialog to display under the project node in the Solution Explorer?
Thanks for your help!!