其实DLL调用.exe.config中的custom configSetting是没有问题的,是我自己的spell问题,造成命名空间和XML节点名不一致。纠正之后,一切Okay了。
如果配置文件中的
所指出的type的最前面的namespace写错了,那么就会导致下面的错误:
DLL里面执行
return (ActionNode[])ConfigurationSettings.GetConfig("ActiveServlet");
时,会直接发生这样的异常:
Exception Information
*********************************************
Exception Type:
System.Configuration.ConfigurationException
Message: Could not create ActiveServlet.ActionConfigurationSectionHandler,ActiionServlet;
StackTrace Information
*********************************************
at System.Configuration.ConfigurationRecord.GetFactory
(String configKey)
at System.Configuration.ConfigurationRecord.Evaluate
(String configKey)
at
System.Configuration.ConfigurationRecord.ResolveConfig
(String configKey)
at System.Configuration.ConfigurationRecord.GetConfig
(String configKey)
at
System.Configuration.ConfigurationRecord.ResolveConfig
(String configKey)
at System.Configuration.ConfigurationRecord.GetConfig
(String configKey)
at
System.Configuration.DefaultConfigurationSystem.System.Con
figuration.IConfigurationSystem.GetConfig(String
configKey)
at System.Configuration.ConfigurationSettings.GetConfig
(String sectionName)
实际上有人遇到和我类似的错误:
但是Mark指出他可以通过“using a config file which was named & located correctly”来纠正错误,那我呢,就因为这个拼写?
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=59265