我正在编写自己的自定义项目模板,以供在Visual Studio中使用。除了需要找到一种方法让模板中的某个文件依赖于另一个文件外,一切都很顺利。
在csproj文件中,它应该是这样的:
<Compile Include="Class1.cs">
<DependentUpon>Class1.xml</DependentUpon>
</Compile>
有人知道我如何在vstemplate文件中定义这个吗?
谢谢。
我正在编写自己的自定义项目模板,以供在Visual Studio中使用。除了需要找到一种方法让模板中的某个文件依赖于另一个文件外,一切都很顺利。
在csproj文件中,它应该是这样的:
<Compile Include="Class1.cs">
<DependentUpon>Class1.xml</DependentUpon>
</Compile>
<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>
不确定非托管文件类型(即VS不知道的文件类型,如您的文件)是否可以自动发生这种情况...
一个技巧是使用WizardExtensions(搜索编写基本向导的示例),像这样:
或者
希望这有所帮助...