如何转义 .env 文件中的 = 符号
我尝试使用 .env 文件创建应用程序配置,首先我可以获得此配置的变量值。
APPLICATION_NAME=MyApps
LOGGING__LOGLEVEL__DEFAULT=Warning
PROPERTY=value
结果: 结果 1
但是,当我尝试将 ConnectionString 变量添加到 .env 文件时。运行我的应用程序时,此变量的值始终返回 null
CONNECTIONSTRINGS__CONN=Database=master;Server=(local);Integrated Security=SSPI;
Result : 结果 2
我认为 Database=master;Server=(local) 上的 = 符号
将检测为命令。谁能帮我解释为什么会发生这种情况,以及如何转义 .env 文件中的 = 符号?
I try to create an application configuration with .env file, for the first I can get the value of variables for this config.
APPLICATION_NAME=MyApps
LOGGING__LOGLEVEL__DEFAULT=Warning
PROPERTY=value
Result :
Result 1
But, when I try to add ConnectionString variable to .env file. And running my application, the value for this variable always returns null
CONNECTIONSTRINGS__CONN=Database=master;Server=(local);Integrated Security=SSPI;
Result :
Result 2
I think the = symbol on Database=master;Server=(local)
will detect as a command. Can anyone help me to explain why this happens, And how to escape the = symbol in .env file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论