我正在尝试从 app.config 读取设置,如下所示
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Chrome" value="path to the chrome driver" />
<add key="IE32" value="path to the IE32 driver" />
<add key="IE64" value="path to the IE64 driver" />
<add key="Url" value="url to the site"/>
</appSettings>
</configuration>
我正在使用以下代码来阅读内容
using System;
using System.Configuration;
public static class Config
{
public static string ClientId
{
get
{
return ConfigurationManager.AppSettings["IE32"];
}
}
}
为什么总是返回null?