Visual Studio,csproj:如何在DependentUpon中指定链接文件? [英] Visual Studio, csproj: How can I specify a linked file in DependentUpon?

查看:369
本文介绍了Visual Studio,csproj:如何在DependentUpon中指定链接文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的项目中有一个default.aspx.cs,但是我想使其依赖于链接的default.aspx文件.例如:

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>

这不起作用:

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

对于这两种情况,我都会收到此错误:

For both, I get this error:

在项目文件中找不到文件'default.aspx.cs'的父文件'Default.aspx'.

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?

推荐答案

我尝试了相同的操作,但似乎不支持.检查以下内容: https://bitbucket.org/jfromaniello/nestin/issue/4/在嵌套链接文件时出错"DependentUpon不适用于链接文件."

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

这篇关于Visual Studio,csproj:如何在DependentUpon中指定链接文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆