Re: ConfigurationManager in Beta2

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello,
System.Configuration.ConfigurationSettings.AppSettings["server"];
works.

but i'v got a warning:
Warning 2 'System.Configuration.ConfigurationSettings.AppSettings' is
obsolete: 'This method is obsolete, it has been replaced by
ConfigurationManager.AppSettings'

i tryed to follow Microsofts suggestion to use ConfigurationManager.

Michael


"Alex Feinman [MVP]" <public_news@xxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:uRS4pldhFHA.3936@xxxxxxxxxxxxxxxxxxxxxxx
>I think it should be
> string s=System.Configuration.Configuration.AppSettings["server"];
>
>
> --
> Alex Feinman
> ---
> Visit http://www.opennetcf.org
> "Michael Debus" <mdebus@xxxxxxxxxxx> wrote in message
> news:dasved$oom$00$1@xxxxxxxxxxxxxxxxxxxx
>> Hi, I try to read a value from app.config file using this code:
>>
>> string
>> s=System.Configuration.ConfigurationManager.AppSettings["server"].ToString();
>>
>> I got the compiler error:
>>
>> Error 1 The type or namespace name 'ConfigurationManager' does not exist
>> in the namespace 'System.Configuration' (are you missing an assembly
>> reference?) .
>>
>> A reference to System.Configuration.dll is added to the project.
>>
>> My System.Configuration.dll has Version 2.0.50215.44. I there a newer
>> version ?
>>
>> Thanks
>> Michael
>>
>>
>


.



Relevant Pages

  • Re: Window CE 6.0 System.Windows.Forms.Control.CreateGraphics not
    ... warning MSB3245: ... If this reference is required by your code, ... name 'OpenNETCF' could not be found (are you missing a using directive or an ... C:\ClippingSample\NetUI\Form1.cs: error CS0246: The type or namespace ...
    (microsoft.public.windowsce.embedded)
  • Re: VS2003 and VS2005 side-by-side installation issue
    ... You have to actually add a reference to the System.COnfiguration.dll in the solution explorer. ... the following statement have a compile warning: ... obsolete: 'This method is obsolete, ... the namespace 'System.Configuration' ...
    (microsoft.public.vstudio.general)
  • Re: Linux 2.6.26-rc9
    ... annotate uv_system_init with a matching annotation. ... WARNING: vmlinux.o: Section mismatch in reference from the ...
    (Linux-Kernel)
  • RE: RHEL5 section mismatch warnings
    ... I get a similar set of warning messages when rebuilding the equivalent CentOS kernel. ... Subject: RHEL5 section mismatch warnings ... WARNING: vmlinux - Section mismatch: reference to ...
    (RedHat)
  • 2 section mismatches for v2.6.28-rc3-54-g75fa677
    ... WARNING: vmlinux.o: Section mismatch in reference from the ... # Device Drivers ... # PCI IDE chipsets support ...
    (Linux-Kernel)