I need to separate my appsettings.json
file and one other .json
file which i use for app configuration from all other files when i publish the app.
The out put should be that all files will be at .bin folder which is now the folder destination of the publish profile and the .json files should be at CFG folder which will be at the same level as the bin folder
Asked
Active
Viewed 550 times
0

ATT
- 921
- 3
- 13
- 30
-
If you've known where the config root folder is, you can change its via `.SetBasePath`. See this SO [how-to-setbasepath-in-configurationbuilder](https://stackoverflow.com/questions/46843367/how-to-setbasepath-in-configurationbuilder-in-core-2-0) to take a look. – nwpie May 13 '20 at 08:01
-
I already reading the file from that location. It works fine. The problem is that I'm manually copying the files from published folder to that path after publish – ATT May 13 '20 at 08:39
-
1Understood now. Then goto your csproj, try put `
` in `ItemGroup` section. Use `PreserveNewest ` or `Always` syntax depends on your needs. – nwpie May 13 '20 at 08:53 -
Managed to achieve it with post build events – ATT May 14 '20 at 09:39