简体   繁体   English

C# Solutions Explorer 中的多个自定义 app.config 文件

[英]C# multiple custom app.config files in Solutions Explorer

I have several custom app.config files and they point directly to my Active Solutions Configurations.我有几个自定义 app.config 文件,它们直接指向我的活动解决方案配置。 They seem to work fine, but the last two I added App.Davivienda.config and App.Futura.config do not appear under the App.config tree.它们似乎工作正常,但我添加的最后两个 App.Davivienda.config 和 App.Futura.config 没有出现在 App.config 树下。 They work fine, but why are they not showing there?他们工作正常,但为什么他们不在那里显示?

在此处输入图像描述

The reason they are not showing hierarchically is that your IDE (presumably Visual Studio) didn't know theses files are related.它们没有按层次显示的原因是您的 IDE(可能是 Visual Studio)不知道这些文件是相关的。 It's simple to solve this.解决这个问题很简单。

Open the .csproj file and look at the entries your new files created.打开.csproj文件并查看新文件创建的条目。

They should have been created with a <DependentUpon>App.config</DependentUpon> tag.它们应该是使用<DependentUpon>App.config</DependentUpon>标记创建的。

If not, change your .csproj , and re-open it.如果没有,请更改您的.csproj ,然后重新打开它。

They should look like this:它们应该如下所示:

<Content Include="App.Futura.config">
    <DependentUpon>App.config</DependentUpon>
</Content>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM