我一直在关注加载自定义configSection的msdn上的本教程。 http://msdn.microsoft.com/en-us/library/system.configuration.configurationcollectionattribute.aspx我在asp.net这样做的,我一直在Custom ConfigSection return null
System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(
ConfigurationUserLevel.None) as Configuration;
得到一个错误,所以我删除了,只用于
UrlsSection myUrlsSection =
ConfigurationManager.GetSection("MyUrls") as UrlsSection;
可能有人复制和过去从MSDN代码,并作出项目在asp.net和测试代码,看看他们是否得到相同的错误,或看看如果myUrlsSection = null,如果你没有得到一个问题,你可以分享你做了什么,使其工作
你可以发布你的web.config条目去除部分并使用它吗?如果可以的话,还可以发布UrlsSection类的声明。 – 2011-12-29 22:42:20
我刚刚复制并粘贴了教程做了什么 – ONYX 2011-12-29 22:47:13