How get web config location element?
ConfigurationManager.GetSection("appSettings") returns Okay
ConfigurationManager.GetSection("location") return null
I.E.
…
<location path="FOLDER/Page2.aspx">
...
</location>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The reason you get an error for that is because in .NET, the custom app config section (such as the “location” section in your example) require you to provide a custom configuration section handler.
The main interface you need to use is IConfigurationSectionHandler
Here is an MSDN article on how to create your custom configuration handler.