Obsolete function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    #1

    Obsolete function

    Hi

    When using 'ConfigurationS ettings.AppSett ings.Get' I get the below warning.
    What is the problem and how can I fix it?

    Thanks

    Regards

    = Warning Message =============== =============

    Warning 9 'Public Shared ReadOnly Property AppSettings() As
    System.Collecti ons.Specialized .NameValueColle ction' is obsolete: 'This
    method is obsolete, it has been replaced by
    System.Configur ation!System.Co nfiguration.Con figurationManag er.AppSettings'


  • Tom Shelton

    #2
    Re: Obsolete function

    On May 11, 7:29 pm, "John" <J...@nospam.in fovis.co.ukwrot e:
    Hi
    >
    When using 'ConfigurationS ettings.AppSett ings.Get' I get the below warning.
    What is the problem and how can I fix it?
    >
    Thanks
    >
    Regards
    >
    = Warning Message =============== =============
    >
    Warning 9 'Public Shared ReadOnly Property AppSettings() As
    System.Collecti ons.Specialized .NameValueColle ction' is obsolete: 'This
    method is obsolete, it has been replaced by
    System.Configur ation!System.Co nfiguration.Con figurationManag er.AppSettings'
    They have changed (much improved) the configuration management api's
    in .NET 2.0. This is telling you that you may want to switch to the
    new api's. You do this by adding a reference to
    System.Configur ation.dll, and then you can access your appsettings
    section via ConfigurationMa nager.AppSettin gs.

    Also, you may want to check out the My namespace stuff in VB2005 - it
    has a lot of support for settings.

    --
    Tom Shelton

    Comment

    • John

      #3
      Re: Obsolete function

      Hi

      There is no dll under System.Configur ation. Also System.Configur ation is
      already imported. Using ConfigurationMa nager.AppSettin gs.Get(key) instead of
      ConfigurationSe ttings.AppSetti ngs.Get(key) gives the error
      'ConfigurationM anager' is not declared.

      Thanks

      Regards

      "Tom Shelton" <tom_shelton@co mcast.netwrote in message
      news:1178937122 .719070.261240@ n59g2000hsh.goo glegroups.com.. .
      On May 11, 7:29 pm, "John" <J...@nospam.in fovis.co.ukwrot e:
      >Hi
      >>
      >When using 'ConfigurationS ettings.AppSett ings.Get' I get the below
      >warning.
      >What is the problem and how can I fix it?
      >>
      >Thanks
      >>
      >Regards
      >>
      >= Warning Message =============== =============
      >>
      >Warning 9 'Public Shared ReadOnly Property AppSettings() As
      >System.Collect ions.Specialize d.NameValueColl ection' is obsolete: 'This
      >method is obsolete, it has been replaced by
      >System.Configu ration!System.C onfiguration.Co nfigurationMana ger.AppSettings '
      >
      They have changed (much improved) the configuration management api's
      in .NET 2.0. This is telling you that you may want to switch to the
      new api's. You do this by adding a reference to
      System.Configur ation.dll, and then you can access your appsettings
      section via ConfigurationMa nager.AppSettin gs.
      >
      Also, you may want to check out the My namespace stuff in VB2005 - it
      has a lot of support for settings.
      >
      --
      Tom Shelton
      >

      Comment

      • =?Utf-8?B?RWRC?=

        #4
        Re: Obsolete function

        John,

        Try changing it to this:

        System.Configur ation.Configura tionManager.App Settings

        Ed

        "John" wrote:
        Hi
        >
        There is no dll under System.Configur ation. Also System.Configur ation is
        already imported. Using ConfigurationMa nager.AppSettin gs.Get(key) instead of
        ConfigurationSe ttings.AppSetti ngs.Get(key) gives the error
        'ConfigurationM anager' is not declared.
        >
        Thanks
        >
        Regards
        >
        "Tom Shelton" <tom_shelton@co mcast.netwrote in message
        news:1178937122 .719070.261240@ n59g2000hsh.goo glegroups.com.. .
        On May 11, 7:29 pm, "John" <J...@nospam.in fovis.co.ukwrot e:
        Hi
        >
        When using 'ConfigurationS ettings.AppSett ings.Get' I get the below
        warning.
        What is the problem and how can I fix it?
        >
        Thanks
        >
        Regards
        >
        = Warning Message =============== =============
        >
        Warning 9 'Public Shared ReadOnly Property AppSettings() As
        System.Collecti ons.Specialized .NameValueColle ction' is obsolete: 'This
        method is obsolete, it has been replaced by
        System.Configur ation!System.Co nfiguration.Con figurationManag er.AppSettings'
        They have changed (much improved) the configuration management api's
        in .NET 2.0. This is telling you that you may want to switch to the
        new api's. You do this by adding a reference to
        System.Configur ation.dll, and then you can access your appsettings
        section via ConfigurationMa nager.AppSettin gs.

        Also, you may want to check out the My namespace stuff in VB2005 - it
        has a lot of support for settings.

        --
        Tom Shelton
        >
        >
        >

        Comment

        • John

          #5
          Re: Obsolete function

          Using System.Configur ation.Configura tionManager.App Settings.Get(ke y) gives
          the error 'ConfigurationM anager' is not a member of 'Configuration' .

          Many Thanks

          Regards


          "EdB" <EdB@discussion s.microsoft.com wrote in message
          news:0C5A458B-D44B-4126-991E-6529320D30FE@mi crosoft.com...
          John,
          >
          Try changing it to this:
          >
          System.Configur ation.Configura tionManager.App Settings
          >
          Ed
          >
          "John" wrote:
          >
          >Hi
          >>
          >There is no dll under System.Configur ation. Also System.Configur ation is
          >already imported. Using ConfigurationMa nager.AppSettin gs.Get(key) instead
          >of
          >ConfigurationS ettings.AppSett ings.Get(key) gives the error
          >'Configuration Manager' is not declared.
          >>
          >Thanks
          >>
          >Regards
          >>
          >"Tom Shelton" <tom_shelton@co mcast.netwrote in message
          >news:117893712 2.719070.261240 @n59g2000hsh.go oglegroups.com. ..
          On May 11, 7:29 pm, "John" <J...@nospam.in fovis.co.ukwrot e:
          >Hi
          >>
          >When using 'ConfigurationS ettings.AppSett ings.Get' I get the below
          >warning.
          >What is the problem and how can I fix it?
          >>
          >Thanks
          >>
          >Regards
          >>
          >= Warning Message =============== =============
          >>
          >Warning 9 'Public Shared ReadOnly Property AppSettings() As
          >System.Collect ions.Specialize d.NameValueColl ection' is obsolete: 'This
          >method is obsolete, it has been replaced by
          >System.Configu ration!System.C onfiguration.Co nfigurationMana ger.AppSettings '
          >
          They have changed (much improved) the configuration management api's
          in .NET 2.0. This is telling you that you may want to switch to the
          new api's. You do this by adding a reference to
          System.Configur ation.dll, and then you can access your appsettings
          section via ConfigurationMa nager.AppSettin gs.
          >
          Also, you may want to check out the My namespace stuff in VB2005 - it
          has a lot of support for settings.
          >
          --
          Tom Shelton
          >
          >>
          >>
          >>

          Comment

          • Tom Shelton

            #6
            Re: Obsolete function

            On May 11, 9:40 pm, "John" <J...@nospam.in fovis.co.ukwrot e:
            Hi
            >
            There is no dll under System.Configur ation. Also System.Configur ation is
            already imported. Using ConfigurationMa nager.AppSettin gs.Get(key) instead of
            ConfigurationSe ttings.AppSetti ngs.Get(key) gives the error
            'ConfigurationM anager' is not declared.
            >
            Thanks
            >
            Regards
            >
            "Tom Shelton" <tom_shel...@co mcast.netwrote in message
            >
            news:1178937122 .719070.261240@ n59g2000hsh.goo glegroups.com.. .
            >
            >
            >
            On May 11, 7:29 pm, "John" <J...@nospam.in fovis.co.ukwrot e:
            Hi
            >
            When using 'ConfigurationS ettings.AppSett ings.Get' I get the below
            warning.
            What is the problem and how can I fix it?
            >
            Thanks
            >
            Regards
            >
            = Warning Message =============== =============
            >
            Warning 9 'Public Shared ReadOnly Property AppSettings() As
            System.Collecti ons.Specialized .NameValueColle ction' is obsolete: 'This
            method is obsolete, it has been replaced by
            System.Configur ation!System.Co nfiguration.Con figurationManag er.AppSettings'
            >
            They have changed (much improved) the configuration management api's
            in .NET 2.0. This is telling you that you may want to switch to the
            new api's. You do this by adding a reference to
            System.Configur ation.dll, and then you can access your appsettings
            section via ConfigurationMa nager.AppSettin gs.
            >
            Also, you may want to check out the My namespace stuff in VB2005 - it
            has a lot of support for settings.
            >
            --
            Tom Shelton- Hide quoted text -
            >
            - Show quoted text -
            System.Configur ation.dll - go and add it to your project references.
            System.Configur ation.Configura tionManager lives in that dll. VB2005 -
            may very well add it automatically, because of the new my
            functionality. I can assure you that in .net 2.0 there most certainly
            is a system.configur ation.dll - i work in C#, and it does not import
            it by default.

            --
            Tom Shelton

            Comment

            Working...