ConfigurationErrorsException:此元素当前未与任何上下文相关联 [英] ConfigurationErrorsException: This element is not currently associated with any context
问题描述
我遇到了奇怪的异常,在我看来是与WCF配置对象相关,但是什么是错误是完全不清楚的。 .Configuration.ConfigurationErrorsException'发生在System.Configuration.dll
其他信息:此元素当前未与任何上下文相关联
ServiceModelSectionGroup serviceConfigs =
ServiceModelSectionGroup.GetSectionGroup(config);
ServiceElement serviceConfig =
serviceConfigs.Services.Services [serviceType.ToString()]; <<这里异常
看起来很多其他人已经解决了这个问题,打破此异常 - 请参阅此处 ,这里,这里和这里。没有人似乎有任何想法什么使用这个异常是,虽然。
我应该补充说,我不得不手动添加到我的Debug / Exceptions列表 - 它didn'默认出现。
I am getting strange exception which seems to me is related to WCF configuration object but what is wrong is completely unclear to me
A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll
Additional information: This element is not currently associated with any context
ServiceModelSectionGroup serviceConfigs =
ServiceModelSectionGroup.GetSectionGroup(config);
ServiceElement serviceConfig =
serviceConfigs.Services.Services[serviceType.ToString()]; << here exception
Looks like a lot of other people have solved this problem just by disabling breaking on this exception - see here, here, here and here, for example. Nobody seems to have any idea what use this exception is, though.
I should add that I had to add the exception manually to my Debug/Exceptions list - it didn't appear by default.
这篇关于ConfigurationErrorsException:此元素当前未与任何上下文相关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!