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

查看:167
本文介绍了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

类型'系统.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

推荐答案

看起来很多其他人已经解决了这个问题,突破此例外 - 请参阅 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.

我应该补充说,我必须手动将异常添加到我的调试/例外列表中 - t默认出现。

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