1

I have multiple config files for the different environments for my C# application. They appear as subitems under App.config. The problem is I want to add a new option, in this case JMTelcom, but it appears outside the folder structure. The file seems to be working fine at compile time, but how do I make it appear next to its siblings?

enter image description here

Ben Quan
  • 773
  • 11
  • 25
  • 1
    Does this answer your question? [Can files be nested in VS2017 Solution Explorer for .NET Core (non-ASP.NET Core) projects?](https://stackoverflow.com/questions/43846079/can-files-be-nested-in-vs2017-solution-explorer-for-net-core-non-asp-net-core) – gunr2171 Aug 27 '20 at 14:54

1 Answers1

2
<ItemGroup>
  <Compile Update="App.*.config">
    <DependentUpon>App.config</DependentUpon>
  </Compile>
</ItemGroup>

Add/append above lines to your .csproj file should do the trick. (Assuming your project is using .net core)

Deepak
  • 428
  • 5
  • 12