Lloyd Dupont
9/18/2003 3:40:00 AM
it did, mmhh.....
have to try again.... (I reboot since, that might be a reason)
I don''t understand !
do you have some [STAThrea] attribute on your main ?
"Pawan" <pawan_atl@hotmail.com> wrote in message
news:eNU4XhleDHA.3268@tk2msftngp13.phx.gbl...
> Lloyd,
> I tried to use this and it absolutely works fine .....
> object port = new AppSettingsReader().GetValue("Lion''s Port",
> typeof(int));
>
> imageDescription.Text = port.ToString();
>
> Cheers ..
> Pawan.
>
>
>
>
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:uCz078keDHA.2432@TK2MSFTNGP09.phx.gbl...
> > for this config file:
> > //--------
> > <?xml version="1.0" encoding="utf-8" ?>
> > <configuration>
> > <appSettings>
> > <add key="Lion''s Port"
> > value="1971"/>
> > </appSettings>
> > </configuration>
> > //--------
> >
> > the following call work:
> > string sPort = ConfigurationSettings.AppSettings.Get("Lion''s Port");
> >
> > but this one fail:
> > object port = new AppSettingsReader().GetValue("Lion''s Port",
> typeof(int));
> >
> > with the error: the key ''Lion''s Port'' doesn''t exist in the appSettings
> > section
> >
> > what''s wrong ?
> >
> >
>
>