Cannot read app.config, why???

Posted by user46503 on Stack Overflow See other posts from Stack Overflow or by user46503
Published on 2010-03-28T06:52:30Z Indexed on 2010/03/28 7:03 UTC
Read the original article Hit count: 262

Filed under:
|

Hello, I'm trying to get data from app.config and I always get zero. The App.config is here:

    <?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="ExplorerContext" connectionString="metadata=res://*/ExplorerData.csdl|res://*/ExplorerData.ssdl|res://*/ExplorerData.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=MYT\SQLEXPRESS;Initial Catalog=Explorer;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>

Could someone explain what is wrong, why I cannot get the values, System.Configuration.ConfigurationManager.AppSettings.Count is always 0

Thanks

© Stack Overflow or respective owner

Related posts about .NET

Related posts about app.config