的appSettings值我在我的web.config以下:无法读取的Web.Config
<configuration>
<appSettings>
<add key="PsychMon" value="true"/>
</appSettings>
. . .
</configuration>
我在我的代码隐藏在下面的代码:
System.Configuration.Configuration webConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(null) ;
然而,当我看看webConfig,webConfig.AppSettings.Settings.Count = 0。
它为什么不读取应用程序设置?
我想要做的是能够通过使用获得的设置:
System.Configuration.KeyValueConfigurationElement psych =
webConfig.AppSettings.Settings["PsychMon"];
我使用C#3.5,VS 2008