I have config files: confing.yml and scenarios.yml that are in the /config/ folder in my source. I use this code to find the configurations at the expected location using relative path:
string currentAssblLoc = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
string confFileLoc = currentAssblLoc + @"\config\config.yaml";
When I compile the app, the executable is moved to the debug folder, but the config files are not.
Question: taking into account the release version of the compiled assembly and the debug mode in which developers are writing code where should I place the config files. Is there a way for these files to be moved into the appropriate folders that can be defined in the project properties and what are some recommended practices around that.
Update: I see that the contents of the config folder are included in the .csproj
file
<ItemGroup>
<None Include="App.config" />
<None Include="config\config.yml" />
<None Include="config\scenarios.yml" />
<None Include="packages.config" />
</ItemGroup>