在我的App.config文件中,我正在尝试引用一个不在项目中的文件,我已经读过绝对路径应该有效。但是,我无法让它发挥作用。
我的App.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
...
<appSettings file="C:/configs/Secrets.config" />
</configuration>
然后在引用的文件中:
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<add key="Username" value="user" />
<add key="Password" value="password" />
</appSettings>
但是,当我运行我的项目时,appSettings没有附加值。我究竟做错了什么?
隐藏的扩展名,文件名实际上是Sectrets.config.txt,因为我没有将其保存为配置文件