Acessando app.config no ASP.NET
Estou usando o arquivo app.config para ler dados dele. Estou carregando o arquivo app.config como:
string app_path = HttpContext.Current.Server.MapPath("app.config");
xmlDoc.Load(app_path);
string image_path = ConfigurationManager.AppSettings["Test1"];
e eu quero obter o valor de "Test1". Mas o valor de test1 está chegando "null" .. como posso obter o valor de "test1" do arquivo app.config? Criei o arquivo app.config como:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Test1" value="My value 1" />
<add key="Test2" value="Another value 2" />
</appSettings>
</configuration>
por favor, me ajude.