Reputation: 6722
I'm writing my own custom item template for use within visual studio. All is well except I need to find a way to get one of the files in the template to be dependent upon another.
In a csproj file it would look like this
<Compile Include="Class1.cs">
<DependentUpon>Class1.xml</DependentUpon>
</Compile>
Does anybody have any idea how I would define this in the vstemplate file?
Thanks
Upvotes: 8
Views: 2244
Reputation: 446
<ProjectItem SubType="Code" TargetFileName="$fileinputname$.cs" ReplaceParameters="true">Test.cs</ProjectItem>
<ProjectItem SubType="Code" TargetFileName="$fileinputname$.cs\$fileinputname$Dependent.cs" ReplaceParameters="true">TestDependent.cs</ProjectItem>
Upvotes: 17
Reputation: 76258
Not sure if this can happen automatically for non-managed file types (i.e. file types that VS doesn't know about, like yours)...
A hack would be to use WizardExtensions (google for examples on writing a basic wizard) like this:
or
hope this helps...
Upvotes: 0