Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 557
Tatiana Racheva Avatar asked Mar 12 '13 22:03

Tatiana Racheva


1 Answers

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."

like image 122
A member Avatar answered Oct 12 '22 08:10

A member