其實(shí)DLL調(diào)用.exe.config中的custom configSetting是沒(méi)有問(wèn)題的,是我自己的spell問(wèn)題,造成命名空間和XML節(jié)點(diǎn)名不一致。糾正之后,一切Okay了。
如果配置文件中的
所指出的type的最前面的namespace寫(xiě)錯(cuò)了,那么就會(huì)導(dǎo)致下面的錯(cuò)誤:
DLL里面執(zhí)行
return (ActionNode[])ConfigurationSettings.GetConfig("ActiveServlet");
時(shí),會(huì)直接發(fā)生這樣的異常:
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)
實(shí)際上有人遇到和我類似的錯(cuò)誤:
但是Mark指出他可以通過(guò)“using a config file which was named & located correctly”來(lái)糾正錯(cuò)誤,那我呢,就因?yàn)檫@個(gè)拼寫(xiě)?
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=59265
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
