假设我的项目中有一个default.aspx.cs,但我想让它依赖于链接的default.aspx 文件。例如:
<Content Include="..\somedir\default.aspx">
<Link>Default.aspx</Link>
</Content>
这不起作用:
<Compile Include="default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
这也不起作用:
<Compile Include="default.aspx.cs">
<DependentUpon>..\somedir\default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
对于两者,我都收到此错误:
The parent file, 'Default.aspx', for file 'default.aspx.cs' cannot be found in the project file.
是否可以让一个文件依赖于一个链接文件?
最佳答案
我尝试了同样的事情,但似乎不支持。检查这个:https://bitbucket.org/jfromaniello/nestin/issue/4/error-when-nesting-linked-files “DependentUpon 不适用于链接文件。”
关于visual-studio - Visual Studio,csproj : How can I specify a linked file in DependentUpon?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15373780/