Thoughts, Tips and Tricks on what I'm currently do for a living. Currently most of my spare time is spent on contributing to Akka.NET.

Sunday, February 13, 2011

Set Custom Tool in the Item Template file

Documentation for setting the Custom Tool property for a project item created from an item template is not exactly easily found.

There are two things you need in the .vstemplate-file (I’ll assume you know how to create item templates). First you need to include a WizardExtension-node and next you need to specify a CustomTool attribute on the ProjectItem. Both are marked in yellow below.

<VSTemplate Version="3.0.0" xmlns="" Type="Item">
    <Name>My File</Name>
    <Description>My File</Description>
<WizardExtension> <Assembly>Microsoft.VSDesigner, Version=, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly> <FullClassName>Microsoft.VSDesigner.ProjectWizard.ItemPropertyWizard</FullClassName> </WizardExtension>
<TemplateContent> <References /> <ProjectItem SubType="Code" TargetFileName="$fileinputname$.txt" ReplaceParameters="false" CustomTool="MyCustomTool">MyFile.txt</ProjectItem> </TemplateContent> </VSTemplate>

1 comment: