ConfigurationErrorsException:此元素当前未与任何上下文相关联 [英] ConfigurationErrorsException: This element is not currently associated with any context

查看:229
本文介绍了ConfigurationErrorsException:此元素当前未与任何上下文相关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我遇到了奇怪的异常,在我看来是与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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆