Visual Studio, csproj: How can I specify a linked file in DependentUpon?

限于喜欢 提交于 2019-12-23 09:34:44

问题


Suppose I have a default.aspx.cs in my project, but I want to make it dependent upon the default.aspx file that's linked. E.g.:

<Content Include="..\somedir\default.aspx">
  <Link>Default.aspx</Link>
</Content>

This doesn't work:

<Compile Include="default.aspx.cs">
  <DependentUpon>Default.aspx</DependentUpon>    
  <SubType>ASPXCodeBehind</SubType>
</Compile>

This also doesn't work:

<Compile Include="default.aspx.cs">
  <DependentUpon>..\somedir\default.aspx</DependentUpon>    
  <SubType>ASPXCodeBehind</SubType>
</Compile>

For both, I get this error:

The parent file, 'Default.aspx', for file 'default.aspx.cs' cannot be found in the project file.

Is it possible to have a file be dependent upon a linked file?


回答1:


I tried the same thing and it seems is not supported. Check this: https://bitbucket.org/jfromaniello/nestin/issue/4/error-when-nesting-linked-files "DependentUpon does not work with linked files."



来源:https://stackoverflow.com/questions/15373780/visual-studio-csproj-how-can-i-specify-a-linked-file-in-dependentupon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!