Section or group name 'appSettings' is already defined. Updates to

Discussion in 'ASP .Net' started by =?Utf-8?B?RnVlaG5lcg==?=, Nov 15, 2005.

  1. Everyone--

    I installed the .NET 2.0 framework on a server that also has version 1.1
    installed. A few of my applications override the "appSettings" section in the
    web.config with a custom config handler.

    This all worked fine prior to installing the 2.0 framework but, now I get
    the following error...

    Section or group name 'appSettings' is already defined. Updates to this may
    only occur at the configuration level where it is defined.

    Line 4: <remove name="appSettings"/>
    Line 5:
    Line 6: <section name="appSettings"
    type="ConfigHandler.ConfigHandler,ConfigHandler"/>

    Any reason why this wouldn't work after .NET 2.0 framework was installed.
    These web applications are set in IIS to use the 1.1 version of the
    framework...

    And, how can I fix this..?

    Thanks,

    --F
    =?Utf-8?B?RnVlaG5lcg==?=, Nov 15, 2005
    #1
    1. Advertising

  2. You don't need to re-define the appSettings element in 2.0.

    What you remove are the keys, not the section itself.
    See : http://msdn2.microsoft.com/en-us/library/ms228241

    If you want to use an external file for the appSettings, use :

    <appSettings configSource="appSettings.config"/>

    See : http://msdn2.microsoft.com/en-us/library/ms228154

    In the .NET Framework version 2.0, you can now include configuration settings
    in a separate file for all configuration elements that support the configSource
    attribute. However, when you use the configSource attribute, you must move
    the entire section to the separate file because there is no merging of element settings.

    There is a one-time write to the Web.config file when using the configSource attribute.
    This causes the application to restart, but subsequent updates to the section are written
    directly to the separate file and do not cause subsequent application restarts.

    For more information, see :
    http://msdn2.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource

    re:
    > These web applications are set in IIS
    > to use the 1.1 version of the framework...


    They should work exactly the same way, then.

    There's *no* communication between
    the 1.1 Framework and the 2.0 Framework.

    Check to see if inadvertently, the Application has
    been configured to run against the 2.0 Framework.




    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    ASPNETFAQ.COM : http://www.aspnetfaq.com/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================

    <> wrote in message
    news:D...
    > Everyone--
    >
    > I installed the .NET 2.0 framework on a server that also has version 1.1
    > installed. A few of my applications override the "appSettings" section in the
    > web.config with a custom config handler.
    >
    > This all worked fine prior to installing the 2.0 framework but, now I get
    > the following error...
    >
    > Section or group name 'appSettings' is already defined. Updates to this may
    > only occur at the configuration level where it is defined.
    >
    > Line 4: <remove name="appSettings"/>
    > Line 5:
    > Line 6: <section name="appSettings"
    > type="ConfigHandler.ConfigHandler,ConfigHandler"/>
    >
    > Any reason why this wouldn't work after .NET 2.0 framework was installed.
    > These web applications are set in IIS to use the 1.1 version of the
    > framework...
    >
    > And, how can I fix this..?
    >
    > Thanks,
    >
    > --F
    Juan T. Llibre, Nov 15, 2005
    #2
    1. Advertising

  3. Re: Section or group name 'appSettings' is already defined. Update

    Juan--

    Thanks for the reply. I understand what your saying with regards to a .NET
    2.0 application but, the issue I'm experiencing is with a .NET 1.1
    application running on the same box where .NET 2.0 is installed...

    So, essentially I have both .NET 1.1 and .NET 2.0 frameworks installed on
    the same box and am running applications that were developed using .NET 1.1
    and .NET 2.0...

    Why would a .NET 1.1 app be failing when it's dependant upon the .NET 1.1
    framework..?



    "Juan T. Llibre" wrote:

    > You don't need to re-define the appSettings element in 2.0.
    >
    > What you remove are the keys, not the section itself.
    > See : http://msdn2.microsoft.com/en-us/library/ms228241
    >
    > If you want to use an external file for the appSettings, use :
    >
    > <appSettings configSource="appSettings.config"/>
    >
    > See : http://msdn2.microsoft.com/en-us/library/ms228154
    >
    > In the .NET Framework version 2.0, you can now include configuration settings
    > in a separate file for all configuration elements that support the configSource
    > attribute. However, when you use the configSource attribute, you must move
    > the entire section to the separate file because there is no merging of element settings.
    >
    > There is a one-time write to the Web.config file when using the configSource attribute.
    > This causes the application to restart, but subsequent updates to the section are written
    > directly to the separate file and do not cause subsequent application restarts.
    >
    > For more information, see :
    > http://msdn2.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource
    >
    > re:
    > > These web applications are set in IIS
    > > to use the 1.1 version of the framework...

    >
    > They should work exactly the same way, then.
    >
    > There's *no* communication between
    > the 1.1 Framework and the 2.0 Framework.
    >
    > Check to see if inadvertently, the Application has
    > been configured to run against the 2.0 Framework.
    >
    >
    >
    >
    > Juan T. Llibre, ASP.NET MVP
    > ASP.NET FAQ : http://asp.net.do/faq/
    > ASPNETFAQ.COM : http://www.aspnetfaq.com/
    > Foros de ASP.NET en Español : http://asp.net.do/foros/
    > ======================================
    >
    > <> wrote in message
    > news:D...
    > > Everyone--
    > >
    > > I installed the .NET 2.0 framework on a server that also has version 1.1
    > > installed. A few of my applications override the "appSettings" section in the
    > > web.config with a custom config handler.
    > >
    > > This all worked fine prior to installing the 2.0 framework but, now I get
    > > the following error...
    > >
    > > Section or group name 'appSettings' is already defined. Updates to this may
    > > only occur at the configuration level where it is defined.
    > >
    > > Line 4: <remove name="appSettings"/>
    > > Line 5:
    > > Line 6: <section name="appSettings"
    > > type="ConfigHandler.ConfigHandler,ConfigHandler"/>
    > >
    > > Any reason why this wouldn't work after .NET 2.0 framework was installed.
    > > These web applications are set in IIS to use the 1.1 version of the
    > > framework...
    > >
    > > And, how can I fix this..?
    > >
    > > Thanks,
    > >
    > > --F

    >
    >
    >
    >
    >
    >
    >
    >
    >
    =?Utf-8?B?RnVlaG5lcg==?=, Nov 15, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jared Hagel
    Replies:
    2
    Views:
    3,316
    Jared Hagel
    Apr 7, 2005
  2. Oodini
    Replies:
    1
    Views:
    1,767
    Keith Thompson
    Sep 27, 2005
  3. Sergei Shelukhin
    Replies:
    1
    Views:
    1,142
    David
    Mar 29, 2007
  4. shapper

    Get AppSettings Section

    shapper, Nov 6, 2008, in forum: ASP .Net
    Replies:
    5
    Views:
    1,858
    Jimbo M
    Nov 19, 2008
  5. kampy
    Replies:
    9
    Views:
    330
    Steven D'Aprano
    Oct 19, 2012
Loading...

Share This Page