cbinder
cbinder

Reputation: 2506

Change root element of App.config for .net application

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"

Upvotes: 0

Views: 416

Answers (2)

Nikhil Vartak
Nikhil Vartak

Reputation: 5127

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/

Upvotes: 1

Scott Hannen
Scott Hannen

Reputation: 29282

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

Upvotes: 0

Related Questions