How to read the Section from Config file from c# code -
while reading config section through c# , getting error in line 1.
the application relative virtual path '~' not allowed here.
system.configuration.configuration config = system.web.configuration.webconfigurationmanager.openwebconfiguration("~"); systemwebsectiongroup grp = (systemwebsectiongroup)config.getsectiongroup("system.web");
my guess value of "~" not allowed when calling openwebconfiguration, that's guess reading error message. documentation openwebconfiguration (http://msdn.microsoft.com/en-us/library/ms151456(v=vs.110).aspx) says pass null
if want root web.config.
Comments
Post a Comment