【发布时间】:2020-11-20 00:23:00
【问题描述】:
我有一个 dotnet 应用程序,我需要从两个相对路径(常规 appsettings.Json、appsettings.Development.json)以及绝对路径 /config/appsettings.json 中提取配置。我找不到办法做到这一点。从the docs,路径arg 是Path relative to the base path stored in Properties of builder. 如何设置它以从绝对路径/config/filename.json 读取配置?
动机:
我正在对 dotnet 应用程序进行 docker 化,因此我计划保留不会通常在常规 publish/appsettings.json 中的部署之间更改的配置,并在 /config/appsettings.json 中部署特定配置(这是我'将在部署时挂载到容器上)。
【问题讨论】:
标签: c# .net asp.net-web-api .net-core