I'm trying to use the following command:
Dim xmlFilePath As String = _
System.Configuration.ConfigurationManager.AppSettings("XmlFilePath")
to retrieve the following setting:
<applicationSettings>
<MySolution.WebProject.My.MySettings>
<setting name="XmlFilePath" serializeAs="String">
<value>C:\ASP.NET\Folder\MessageLog</value>
</setting>
</MySolution.WebProject.My.MySettings>
</applicationSettings>
However, xmlFilePath
shows up as Nothing
after that line of code is run.
What's the correct code to get a setting out of the web.config file in an ASP.NET application?
NOTE: Although you can add keys individually to the <appsettings>
tag, I'm trying to figure out how to use it with the "Settings" tab in the project's properties.