Docs: <remove> and <clear> are not work in <configSections>

Created on 16 Nov 2017  Â·  12Comments  Â·  Source: dotnet/docs

I follow this docs/clear-element-for-configsections.md at master · dotnet/docs
this is my app.config file

<configSections>
  <clear/>
  <remove name="oracle.manageddataaccess.client" />
  <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess" />

but I still get error

System.Configuration.ConfigurationErrorsException: Section or group name 'oracle.manageddataaccess.client" is already defined. Updates to this may only occur at the configuration level where it is defined.

I have found this ASP.NET MVC Web.Config inheritance problem | Microsoft Connect

clear and remove were never implemented for configSections and sectionGroups because of the difficulty involved attempting to merge different definitions of the same section-handlers and section groups.

I don't which is right.

Area - .NET Framework Guide P2 doc-bug

Most helpful comment

All 12 comments

@qiaoxingxing thanks for reporting the issue. The Connect bug probably has the right information.

@davidfowl @danroth27 who could we talk to confirm the config section behavior for ASP.NET? Thanks.

@csharpfritz Can you help direct this to the right folks?

We should connect with @StephenMolloy and @HongGit for triage

Can confirm that this bug affects Web.config files of ASP.NET MVC5 projects target .net4.7.1

will this be fixed?

As the original issue report points out, remove and clear were never implemented. They haven't existed since before 2.0, and I doubt they existed before that. The documentation should be fixed, but I don't see these features being implemented at this point.

There should be a simple solution then to stop inheriting. Nothing works
right now to cover the entire config, not even altering the definition of
the app pool to not allow it.

On Thu, Apr 26, 2018 at 11:15 AM, StephenMolloy notifications@github.com
wrote:

As the original issue report points out, remove and clear were never
implemented. They haven't existed since before 2.0, and I doubt they
existed before that. The documentation should be fixed, but I don't see
these features being implemented at this point.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/dotnet/docs/issues/3708#issuecomment-384700721, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AI3qr4hFHQfeB9CtORoQ4vlfweveBN0jks5tsfKSgaJpZM4Qf-Ry
.

I am also experiencing this. I don't want to stop inheritance from the machine.config side--I want to override this section on the web.config side, just as qiaoxingxing wrote.

Still having this problem, and the documentation is still wrong. Can that at least be corrected?

These will never be implemented. So please don't hold out hope that they will.

The docs should be updated though. @Rick-Anderson, do you know who would be able to fix the docs to reflect that 'remove' and 'clear' aren't a thing in the 'configSections' area of config?

@StephenMolloy I can take care of it.

@gewarren my plan is to update the remarks to say these elements do not clear/remove . I'll delete the Example
In Configuration file, I'll say these don't clear/remove

<remove> element for <configSections>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gmatv picture gmatv  Â·  3Comments

sime3000 picture sime3000  Â·  3Comments

sebagomez picture sebagomez  Â·  3Comments

LJ9999 picture LJ9999  Â·  3Comments

ike86 picture ike86  Â·  3Comments