“DbProviderFactories”部分只能在配置文件中显示一次 [英] The 'DbProviderFactories' section can only appear once per config file

查看:245
本文介绍了“DbProviderFactories”部分只能在配置文件中显示一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用实体框架调用WCF .net 4.0服务时,我们收到此错误。

We are receiving this error when calling a WCF .net 4.0 service using entity framework.

The 'DbProviderFactories' section can only appear once per config file

它是使用EF和其他.net 4.0的服务器上的第一个应用程序WCF服务没有收到此错误。

It is the first app on the server using EF and other .net 4.0 WCF services are not receiving this error.

有没有办法通过编辑服务器上的机器配置文件来纠正这个错误?

Is there any way to correct this error with out editing the machine config file on the server?

推荐答案

也许您可以创建web.config条目,覆盖您想要更改的任何机器范围的设置。

Maybe you could create web.config entries which override any machine-wide settings you want changed.

此处描述:

通过web.config覆盖machine.config

清除/ config中的 DbProviderFactories 标签中的/ / code>指令,以清除并重新配置机器配置中重复的条目。因此,在machine.config中的错误中进行了一次攻击。

Putting the <clear /> instruction inside of the DbProviderFactories tags in the web config to clear out and then override the duplicate entries made in the machine config. Thus doing a hack-work around of the error in the machine.config.

这篇关于“DbProviderFactories”部分只能在配置文件中显示一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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