Visual Studio 自定义项模板依赖于
我正在编写自己的自定义项目模板,以便在 Visual Studio 中使用。一切都很好,除了我需要找到一种方法使模板中的一个文件依赖于另一个文件。
在 csproj 文件中,它看起来像这样
<Compile Include="Class1.cs">
<DependentUpon>Class1.xml</DependentUpon>
</Compile>
有人知道我如何在 vstemplate 文件中定义它吗?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不确定对于非托管文件类型(即 VS 不知道的文件类型,例如您的文件类型)是否会自动发生这种情况...
一个黑客方法是使用 WizardExtensions(google 提供有关编写基本向导的示例),如下所示:
,或者
希望这有帮助...
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...