Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a item template for Visual Studio 2008, with file-dependencies, is it possible?
    primarykey
    data
    text
    <p>I have a template that adds a new entry to the "Add->New item" right-click menu on a project in the solution explorer in Visual Studio.</p> <p>I have already built the template, put it into my ItemTemplates directory beneath my documents folder, and it works, in the sense that I can add new items to the project through the template.</p> <p>However, the template consists of 3 files:</p> <pre><code>&lt;filename&gt;.controller &lt;filename&gt;.Designer.cs &lt;filename&gt;.cs </code></pre> <p>These are added to the project at the same level, but I'd like to have the same kind of hierarchy you get when you add a form to the project, where the .Designer.cs file is placed as a sub-node beneath the .cs file.</p> <p>Basically, this is what the project looks like:</p> <pre><code>TestProject +- Properties +- References +- App.config +- Program.cs +- MyTestController.controller +- MyTestController.Designer.cs +- MyTestController.cs </code></pre> <p>whereas I want it to look like this:</p> <pre><code>TestProject +- Properties +- References +- App.config +- Program.cs +- MyTestController.controller +- MyTestController.Designer.cs +- MyTestController.cs </code></pre> <p>is this possible? If so, what do I change in my .vstemplate file to get this behaviour?</p> <p>Here's the .vstemplate file I've added to the template zip file:</p> <pre><code>&lt;VSTemplate Version="2.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"&gt; &lt;TemplateData&gt; &lt;Name&gt;LVK.NET New Controller&lt;/Name&gt; &lt;Description&gt;Adds an business logic controller class to the project.&lt;/Description&gt; &lt;Icon Package="{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}" ID="4522" /&gt; &lt;ProjectType&gt;CSharp&lt;/ProjectType&gt; &lt;SortOrder&gt;10&lt;/SortOrder&gt; &lt;DefaultName&gt;Controller.controller&lt;/DefaultName&gt; &lt;/TemplateData&gt; &lt;TemplateContent&gt; &lt;References&gt; &lt;Reference&gt; &lt;Assembly&gt;System&lt;/Assembly&gt; &lt;/Reference&gt; &lt;Reference&gt; &lt;Assembly&gt;System.Data&lt;/Assembly&gt; &lt;/Reference&gt; &lt;Reference&gt; &lt;Assembly&gt;System.Xml&lt;/Assembly&gt;:\ &lt;/Reference&gt; &lt;Reference&gt; &lt;Assembly&gt;LVK.Core&lt;/Assembly&gt; &lt;/Reference&gt; &lt;Reference&gt; &lt;Assembly&gt;LVK.BusinessLogic&lt;/Assembly&gt; &lt;/Reference&gt; &lt;/References&gt; &lt;ProjectItem ReplaceParameters="true"&gt;Controller.controller&lt;/ProjectItem&gt; &lt;ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$.Designer.cs"&gt;Controller.Designer.cs&lt;/ProjectItem&gt; &lt;ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$.cs"&gt;Controller.cs&lt;/ProjectItem&gt; &lt;/TemplateContent&gt; &lt;/VSTemplate&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload