I want to create template with this three files :
Handler.cs
Feature.Request.cs
Feature.Result.cs
I created these files and modify ‘MyTemplate.vstemplate’ file content to this :
<TemplateContent>
<ProjectItem TargetFileName="Handler.cs" >
Feature.Handler.cs
</ProjectItem>
<ProjectItem TargetFileName="$fileinputname$.Request.cs" DependentUpon="Handler.cs" >
Feature.Request.cs
</ProjectItem>
<ProjectItem TargetFileName="$fileinputname$.Result.cs" DependentUpon="Handler.cs">
Feature.Result.cs
</ProjectItem>
</TemplateContent>
This works fine and it is displayed correctly in solution explorer :
enter image description here
But when i want to create dynamic file name for Handler.cs file
its not work .
<TemplateContent>
<ProjectItem TargetFileName="$fileinputname$.Handler.cs" >
Feature.Handler.cs
</ProjectItem>
<ProjectItem TargetFileName="$fileinputname$.Request.cs" DependentUpon="$fileinputname$.Handler.cs" >
Feature.Request.cs
</ProjectItem>
<ProjectItem TargetFileName="$fileinputname$.Result.cs" DependentUpon="$fileinputname$.Handler.cs">
Feature.Result.cs
</ProjectItem>
</TemplateContent>
New contributor
Mobin Valikhani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.