我有这样的代码在我的web.config文件:在一个web.config Retriving设置<configSections>
<configSections>
<section name="myWebAppSettings" type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<myWebAppSettings isTestEnvironment="true"/>
我需要从Global.asax
找回我的价值isTestEviroment
在我使用的那一刻没有成功:
bool isTestEnvironment = ConfigurationManager.AppSettings.GetValues["isTestEnvironment"];
我在做什么错在这里? 注意:我不认为我的Web.Config文件是正确的,所以如果我没有正确写入,请随时更改它。感谢您的帮助!
在哪种方法你想读的设置? (会话开始,应用程序开始)? – sll
in Application_Error – GibboK