在ASP.NET Core中,通过环境变量的嵌套配置通常通过冒号语法完成:
MySettings:SomeSetting = MyNewValue
你是如何在Linux中做到这一点的? export命令拒绝冒号?
例如:
export MySettings:SomeSetting = MyNewValue
错误
bash: export: `MySettings:SomeSetting=MyNewValue': not a valid identifier
仔细阅读
the docs:
If :
cannot be used in environment variables in your system,replace :
with __
(double underscore).
即:
export MySettings__SomeSetting=MyNewValue
原文链接:https://www.f2er.com/netcore/395279.html