0

The standard starting block for App.config looks like this:

<?xml version="1.0" encoding="utf-8" ?> 
<configuration>

Is it possible to change "configuration" to other string value like "StartingConfiguration"

5
  • Specific reason for doing so? You can have 'StartingConfiguration' as a sectionGroup. Also to be a valid XML root node is required, if you make 'StartingConfiguration' as root node and end the file with same. I don't think that's what you would want. Commented Mar 31, 2016 at 6:52
  • Actually we were thinking to use "Configuration" as tag inside another element of which "StartingConfiguration" (root element) could be the parent. Commented Mar 31, 2016 at 7:00
  • Of course it's possible. Whether it's advisable is another question entirely. Perhaps if you provided more context... Commented Mar 31, 2016 at 7:22
  • I am not asking if it is advisable or not. Its a requirement. Commented Mar 31, 2016 at 7:44
  • Have you tried this thing first? If yes and did not work then makes sense to discuss here. Commented Apr 1, 2016 at 6:16

2 Answers 2

1

It is not possible to change the root element of app.config because

The application config file is shared with CLR and Windows SxS. SxS dictates that the root element is , and it should be without namespace.

Source - https://blogs.msdn.microsoft.com/junfeng/2008/03/24/app-configs-root-element-should-be-namespace-less/

Sign up to request clarification or add additional context in comments.

Comments

0

No, it is not possible. Sections starting with "config" are reserved. You can't name a ConfigurationSection "configuration."

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.