Visual Studio: Item Template & Custom Tool

I’m currently working on a project over at CodePlex that I haven’t published yet because I want to make it a little more awesome before I draw back the curtain.  The focus of the project is a Visual Studio integration that has a Custom Tool.  Part of the work involved creating a new Item Template.  For anyone unfamiliar, an Item Template is just a zip file with a .vstemplate manifest file inside telling visual studio how to include the items in the zip file into the project when the item is selected in the new content item window.

What I quickly ran into though was that specifying a custom tool in the template file appeared to not work at all.  What I was doing looked like this:

ReplaceParameters="true"TargetFileName="$fileinputname$.xml">MyItem.xml>>Name="$itemproperties$"Value="CustomTool"/>Name="$CustomTool$"Value="MyCustomTool"/>>>

Which looked completely right based on all the examples I saw online.  But every time I created an item based on the template the CustomTool field in the properties window was always blank, instead of having “MyCustomTool” there.  It took a lot of browsing the web to stumble across what I was missing in my template file to get this to work.

You have to add the following wizard extension section to your item template or Visual Studio wont populate the CustomTool field with whatever you tell it.

>>Microsoft.VSDesigner, Version=8.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a>>Microsoft.VSDesigner.ProjectWizard.ItemPropertyWizard>>

So that you understand the context of where this code goes in the item template, I’ve provided a copy of the entire template here [MyTemplate.vstemplate]