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

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

问题描述

我正奇怪的例外,这在我看来是与WCF配置对象,但什么是错误完全是我不清楚

I am getting strange exception which seems to me is related to WCF configuration object but what is wrong is completely unclear to me

有一个第一次机会异常的类型'System.Configuration.ConfigurationErrorsException的System.Configuration.dll发生

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

推荐答案

看起来像其他很多人刚刚通过禁用打破此异常解决了这个问题 - 请参见<一href="http://social.msdn.microsoft.com/forums/en-US/wcf/thread/2620084b-a77b-4c77-b9ce-725fbea1df55/">here, <一href="http://zamd.net/2008/04/06/configurationerrorsexception-this-element-is-not-currently-associated-with-any-context/">here, 这里和<一href="http://stackoverflow.com/questions/4092645/store-metadata-currentbind-is-not-valid-error/7220736#7220736">here,例如。似乎没有人有什么用这种例外的是,虽然任何想法。

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天全站免登陆